Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino demo source code for KC868-A4]-05 read analog input (ADC) data
#1
Heart 
Code 4: //The demo code is ADC INPUT    You can copy the code to your Arduino IDE

Code:
#define ANALOG_PIN_32   32      //INA1  CH5

// #define ANALOG_PIN_33   33   //INA2  CH4
// #define ANALOG_PIN_34   34   //INA3  CH6
// #define ANALOG_PIN_35   35   //INA4  CH7


void setup(){
  Serial.begin(115200);
  pinMode(ANALOG_PIN_32,INPUT);
}

void loop() {
  int analog_value = 0;
  analog_value = analogRead(ANALOG_PIN_32);   //0--4096
  delay(1000);
  Serial.printf("Current Reading on Pin(%d)=%d\n",ANALOG_PIN_32,analog_value);
}
   
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)