I have been working on a project that involves various button inputs and an LED indicator.
All good until a few hours ago.
The pin next to a flashing LED, although set up as input pullup is generating "rogue" switches.
When I meter it the voltage is cycling from 1.1V to 3.3V in sympathy with the flashing LED on the next pin.
This happens with the Teensy disconnected from everything. I wonder has the LED output pin become compromised. I'm driving the LED to ground via 68 ohm resistor. A simple sketch to illustrate.
All good until a few hours ago.
The pin next to a flashing LED, although set up as input pullup is generating "rogue" switches.
When I meter it the voltage is cycling from 1.1V to 3.3V in sympathy with the flashing LED on the next pin.
This happens with the Teensy disconnected from everything. I wonder has the LED output pin become compromised. I'm driving the LED to ground via 68 ohm resistor. A simple sketch to illustrate.
Code:
#include <elapsedMillis.h>
const int ledPin = 3;
int ledState = HIGH;
elapsedMillis LedTime;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(2, INPUT_PULLUP);
}
void loop() {
if(LedTime >= 1000) {
LedTime=0;
if (ledState == LOW)
ledState = HIGH;
else
ledState = LOW;
digitalWrite(ledPin, ledState);
}
}
Last edited: