418
edits
No edit summary |
No edit summary |
||
Line 34: | Line 34: | ||
[[File:20210505_105123.jpg|400px]] | [[File:20210505_105123.jpg|400px]] | ||
the code i used:[[code]] | the code i used: | ||
[[// global variables | |||
int sensor = A1; // declare variable for sensor at analog input pin | |||
void setup() { | |||
// put your setup code here, to run once: | |||
Serial.begin (9600); // start serial | |||
} | |||
void loop() { | |||
// put your main code here, to run repeatedly: | |||
// declare variable for sensor value | |||
// read our sensor, "put" the reading value into the variable | |||
int sensorValue = analogRead (sensor); | |||
// print our sensor value to the serial monitor | |||
Serial.println (sensorValue); | |||
}]] |
edits