I assume the answer to this is yes (only for digital input) since I can't find any reference to using a built-in pull-down resistor on the analog input pins here or here or on this forum.
If someone could confirm that, it would be great, before I go ahead and permanently install a 10k resistor onto my project.
thanks.
[I'm using a Teensy 3.1 and a light sensor and here is my test code at the moment:
]
If someone could confirm that, it would be great, before I go ahead and permanently install a 10k resistor onto my project.
thanks.
[I'm using a Teensy 3.1 and a light sensor and here is my test code at the moment:
Code:
// Reads analogue signal on pin A0 every second
// and sends the value to serial port
// Define display refresh rate (ms)
#define INTERVAL 1000
// Pin number for on-board LED
#define BOARDLED 13
void setup()
{
Serial.begin(38400);
// Setup pins
pinMode(BOARDLED, OUTPUT);
}
int val;
void loop()
{
val = analogRead(0);
Serial.println(val);
digitalWrite(BOARDLED, HIGH);
delay(50);
digitalWrite(BOARDLED, LOW);
delay(INTERVAL - 50);
}
Last edited: