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

State machine


  • Please log in to reply
3 replies to this topic

#1 perkunas

perkunas

    Advanced Member

  • Members
  • PipPipPip
  • 108 posts

Posted 23 March 2012 - 12:35 AM

Don't know much about the netduino have one sitting here some place, used an arduino for some time. Anyway my questin is about multi tasking need to run multiple pumps same time. With the arduino you need a state machine, either one they offer not much good, or a comercial one way too complicated. Even looked into ocam pi it breaks the 8 bits down to 2 bits but not much suport out there and you need to learn a whole new programing enviroment.I asume I will need to build a state machine with the netduino anything easy out there.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 23 March 2012 - 12:45 AM

Hi perkunas, One of the nice features of .NET Micro Framework is that you can start up a few threads for parallel tasks--and also respond to events instead of polling sensor inputs. You could also build a traditional state machine. Up to you, lots of freedom. Chris

#3 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 23 March 2012 - 01:52 AM

Yup, you can fork up threads and have them synchronized in a classical producer/consumer manner, no problems. You do this in the same way as you would in an ordinary .NET application, only with a slightly lighter set of features.

#4 Bainesbunch

Bainesbunch

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts
  • LocationFrance

Posted 23 March 2012 - 05:56 PM

Yep and the one of the things missing is delegates for cross thread event handling. But since we don’t have any UI as such his is not too much of an issue. I drive almost everything from threads. One for the state control, one to poll user inputs, one to read data in the serial stream and process etc etc. You also have all the event handling too so you don’t actually need to worry about a pin state transition it is all handled for you and an event if fired on change that can be pointed to a method to process it.
I was going to change the world, then I discovered Netduino.
The world will have to wait.




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.