Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Blinky 2.0


  • Please log in to reply
2 replies to this topic

#1 fluke

fluke

    New Member

  • Members
  • Pip
  • 9 posts

Posted 19 October 2010 - 08:17 PM

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.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

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 Jose Torres

Jose Torres

    New Member

  • Members
  • Pip
  • 9 posts

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

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.