EyeofHorus
Member
I was testing if I can control a fan by sending different PWM signals from the Teensy 4.0 to a logic level MOSFET when the Teensy seems to have broken down in some way.
If I connect the Teensy to power, either via USB or via a 5V power supply connected to the pins, the program seems to be running for a short time, somewhere between 0.5 s and 10 s, and then stops working. The LED pin turns off and the Teensy doesn't get recognized anymore by the computer if connected via USB.
Does anyone have an idea if I can salvage the Teensy and why it broke down in the first place, so that I can make sure it won't happen again?
If I connect the Teensy to power, either via USB or via a 5V power supply connected to the pins, the program seems to be running for a short time, somewhere between 0.5 s and 10 s, and then stops working. The LED pin turns off and the Teensy doesn't get recognized anymore by the computer if connected via USB.
Does anyone have an idea if I can salvage the Teensy and why it broke down in the first place, so that I can make sure it won't happen again?
Code:
const int signalPin = 19;
const int LedPin = 13;
int i = 1;
void setup() {
pinMode(signalPin, OUTPUT);
pinMode(LedPin, OUTPUT);
digitalWrite(LedPin, HIGH);
}
void loop()
{
if (i<= 5){
analogWrite(signalPin, i*50);
delay(2000);
i = i+1;
}
else{
i = 1;
}
}