-
-
Save joselynNeon/9084514 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
// open serial port | |
Serial.begin(9600); | |
} | |
void loop() { | |
// read and send the value of analog sensor | |
long raw_val = analogRead(A0); | |
// use to adjust the range, if necessary | |
// int range_offet = 3; | |
// int range_size = 60; | |
// raw_val = raw_val - range_offet; | |
// raw_val = constrain( (raw_val * 1023 / range_size), 0, 1023); | |
Serial.println(raw_val); | |
// wait to send the next value so that you | |
// don't clog up the serial port | |
delay(100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment