I'm writing an application that allows for control of an LED through serial port communication. Basically I send commands (ON, OFF, BLINK) through a serial terminal and the LED turns on/off or blinks. The problem is, once it starts blinking, the program is stuck in an infinite while loop and I can't turn it off.
To be more precise, if an event (keypress) occurs while the program is executing within the infinite blink loop, the event handler recognizes it and adds the character to the buffer, but it will only do this for the first event: every other keypress after is not recognized.
Any ideas on how to run an infinite loop in the background? Or a different approach for blinking an LED?
Thanks.
Blinky 2.0
Started by fluke, Oct 19 2010 08:17 PM
2 replies to this topic
#1
Posted 19 October 2010 - 08:17 PM
#2
Posted 19 October 2010 - 09:20 PM
Hi fluke,
What you're doing _should_ work.
Let's start here:
1. I'd always recommend using event-based programming methods with the Netduino. Infinite loops are traditionally used on microcontrollers, but .NET MF largely gets rid of the need.
2. Could you please post a code snippet which we can all look at to try to reproduce the issue (or point out some tips on how to solve it based on the code alone)?
And...welcome to the Netduino community!
Chris
#3
Posted 19 October 2010 - 09:23 PM
Hey Chris,
Can you paste your infinite loop code here? I'd love to help iron out this bug for you.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users