acastles91
Member
Hello. I am trying to do a very simple measurement of a sensor and both
and
output to the console for a very short moment and then the program becomes irresponsve until I press the button and reboot the teensy. The code I'm running is very simple. The sensor is a QRE1113 (reflective sensor), which is connected to pin 21, to GND and to 3.3V. What I'm I doing wrong?
Code:
analogRead()
Code:
digitalRead()
Code:
const int sensor = 21;
void setup() {
pinMode(sensor, INPUT);
Serial.begin(115200);
}
void loop() {
Serial.println(analogRead(sensor));
}