You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
347 B
22 lines
347 B
4 years ago
|
int analogPin = A3;
|
||
|
|
||
|
int meas = 0;
|
||
|
|
||
|
void setup() {
|
||
|
Serial.begin(9600); // setup serial
|
||
|
}
|
||
|
|
||
|
void loop()
|
||
|
{
|
||
|
meas = analogRead(analogPin); // read the input pin
|
||
|
|
||
|
if (Serial.available())
|
||
|
{
|
||
|
if (Serial.read() == '1')
|
||
|
{
|
||
|
Serial.println(meas); // debug value
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|