Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino source code for KC868-A16S]-04 ADC_code
#1
Code:
#include "Arduino.h"

#define ANALOG_A1   36       
#define ANALOG_A2   34           
#define ANALOG_A3   35       
#define ANALOG_A4   39       

void setup()
{
    Serial.begin(115200);
    delay(1000);

  pinMode(ANALOG_A1,INPUT);
  pinMode(ANALOG_A2,INPUT);
  pinMode(ANALOG_A3,INPUT);
  pinMode(ANALOG_A4,INPUT);
}

void loop()
{
  if(digitalRead(ANALOG_A1)!=0){
    Serial.printf("A1 on Pin(%d)=%d\n",ANALOG_A1,analogRead(ANALOG_A1));
  }
  if(digitalRead(ANALOG_A2)!=0){
    Serial.printf("A2 on Pin(%d)=%d\n",ANALOG_A2,analogRead(ANALOG_A2));
  }

  if(digitalRead(ANALOG_A3)!=0){
    Serial.printf("A3 on Pin(%d)=%d\n",ANALOG_A3,analogRead(ANALOG_A3));
  }

  if(digitalRead(ANALOG_A4)!=0){
    Serial.printf("A4 on Pin(%d)=%d\n",ANALOG_A4,analogRead(ANALOG_A4));
  }
  delay(100);

}
[Arduino source code for KC868-A16S]-04 ADC_code


Attached Files
.zip   A16S_ADC.zip (Size: 580 bytes / Downloads: 176)
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)