Easy Analog Sensor test using the Console

My Class has been testing several analog sensors. The serial connection is hard to work with in a classroom setting, but the particle console is really useful. This little generic analog sensor program has become a necessity.

// Easiest Analog Console test program
// By Jeremy Ellis

// lots of sensors have these labels
// GND Ground
// VCC Normal 5Vin check board may want 3V3
// NC Not Connected - might be label LED
// Sig Connect to A0

void setup() {

}

void loop() {

int myReadA0= analogRead(A0);
String myA0 = String(myReadA0,DEC);

Particle.publish(“Analog Read”, String("A0 = " + myA0), 60, PRIVATE);
delay(6000); // wait about 6 seconds
}

2 Likes

Hey @peekay123 we have been looking at a bunch of your libraries for my massive amount of sensors. I was really pleased when I gave a student a serial sensor I had never used before and it took him a few minutes to get it working. His reply was: “Not UART or SPI it was fairly easy I2C with only one header file”

I think they actually might be learning something: :grinning:

1 Like