04-25-2022, 08:46 AM
(This post was last modified: 04-25-2022, 08:46 AM by KinCony Support.)
[Arduino IDE demo source code for KC868-A6]--#02-ADC_code
ADC.zip (Size: 547 bytes / Downloads: 265)
Code:
/*KC868-A6 ADC code*/
#include "Arduino.h"
#include "PCF8574.h"
#define ANALOG_A1 36
#define ANALOG_A2 39
#define ANALOG_A3 34
#define ANALOG_A4 35
void setup()
{
Serial.begin(115200);
pinMode(ANALOG_A1,INPUT);
pinMode(ANALOG_A2,INPUT);
pinMode(ANALOG_A3,INPUT);
pinMode(ANALOG_A4,INPUT);
}
void loop()
{
Serial.printf("Current Reading A1 on Pin(%d)=%d\n",ANALOG_A1,analogRead(ANALOG_A1));
Serial.printf("Current Reading A2 on Pin(%d)=%d\n",ANALOG_A2,analogRead(ANALOG_A2));
Serial.printf("Current Reading A3 on Pin(%d)=%d\n",ANALOG_A3,analogRead(ANALOG_A3));
Serial.printf("Current Reading A4 on Pin(%d)=%d\n",ANALOG_A4,analogRead(ANALOG_A4));
delay(500);
}
ADC.zip (Size: 547 bytes / Downloads: 265)