

![]() |
  | |||||||||||||
![]() |
|
![]() |
||||||||||||
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.
dab's ContentThere have been 54 items by dab (Search limited from 02-July 24) #4193 What is the Netduino Mini?
That is pretty cool. Small and cheap enough to install in a dedicated project
![]() ![]() #2644 What is need to get started with Netduino?
1K is probably too high a resistance if you're driving LEDs from the Netduino output pins (3.3v). Something like 100 ohms is probably more appropriate for Red or Green LEDs. I think Blue LEDs generally have a higher forward voltage, so you may need an even smaller resistor (or maybe no resistor at all). Best bet is to buy a resistor assortment, and save yourself some frustration. Also, you'll probably want a potentiometer to attach that knob to ![]() If you're just getting started in electronics, I'd highly recommend the Make: Electronics book. It's a great hands-on introduction to basic electronics. It doesn't cover Arduino/Netduino specifically, but it's a good learning guide. #2651 What is need to get started with Netduino?
You can also get the eBook version for US $27.99. #291 Using InterruptPorts?
Gaah, never mind. I just found that the Event Handlers tutorial has been posted in the Projects section. ![]() I'll take a look at that... #315 Using InterruptPorts?
D'oh! Dumb mistake - I was just selecting the "Deploy Solution" menu option from the Build menu. I needed to select "Start Without Debugging" from the Debug menu to get the solution to actually run. ![]() Now both programs work as expected. Move along, nothing to see here... #290 Using InterruptPorts?
Hi,
I decided to try modifying the ButtonApp sample to use interrupts instead of polling the state of the pushbutton switch. I found an example in the book "Embedded Programming with the Microsoft .NET Micro Framework", and kinda mashed up my own ToggleButton app. The basic idea is to have the pushbutton switch "toggle" the LED on and off with each successive press (i.e., the first time the button is pushed and released, the LED turns on, and the next time the button is pushed, the LED turns off, etc.). Here's the code that I came up with. There's probably some unnecessary code in here, since I was trying various ways to make it work. using System; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.Netduino; namespace ToggleButton { public class Program { static InterruptPort button; static OutputPort led; static bool ledState; public static void Main() { // Set the initial state of the LED to off (false). ledState = true; led = new OutputPort(Pins.ONBOARD_LED, ledState); button = new InterruptPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeLevelLow); // Bind the interrupt handler to the pin's interrupt event. button.OnInterrupt += SwitchInterruptHandler; button.EnableInterrupt(); while (true) { Thread.Sleep(Timeout.Infinite); } } public static void SwitchInterruptHandler(UInt32 data1, UInt32 data2, DateTime time) { Debug.Print("+SwitchInterruptHandler"); button.DisableInterrupt(); // Invert the previous state of the LED. ledState = !ledState; // Set the LED to its new state. led.Write(ledState); button.EnableInterrupt(); button.ClearInterrupt(); Debug.Print("-SwitchInterruptHandler"); } } } The problem is that the code seems to run fine under the debugger, but doesn't work as expected when it's not running in the debugger. ![]() Can anybody spot what I'm doing wrong here? Thanks, -David #312 Using InterruptPorts?
Hmm, I seem to have the same issue with the AdvancedButtonApp tutorial. Works as expected under the debugger, but not when I just deploy the solution to the Netduino. Is there some kind of timing issue that's causing this? Has anybody else got this working outside the debugger? #145 Unboxing: first impressions?
I just received mine this weekend from the Maker Shed. I'm not sure exactly when it arrived, since I was out of town this weekend, but it was waiting patiently for me in the mailbox when I got home Sunday evening. ![]() Around 9:00 PM I finally got a chance to open the box. I had ordered another item from Maker Shed, and at first I thought the Netduino had been back-ordered. After looking closer, I saw its little black anti-static bag with the blue label. It's a little smaller than I expected (exact same footprint as Evil Mad Science's Diavolino board). I also found the little rubber feet and the tag, but I don't have a phone that will read it ![]() I got VS2010 Express installed on my machine, then the .NETMF, and finally the Netduino package. I jumped right into the blinkenlight tutorial, and plugged in the Netduino. FWIW, mine didn't come with the micro-USB cable, but I have plenty from other devices, so it wasn't a show stopper for me. At first, Win7 didn't install the driver - then I closed VS2010, unplugged and re-connected the Netduino, and the drivers installed fine. Then I deployed the project to the board, and basked in the glow of the blinking blue light ![]() I must say, it's a better OOBE than my recent foray into the Arduino world (about a month ago). Arduino is cool and all, and I'm sure in many ways it made the Netduino possible. But the Arduino tools feel hacked together, and I've spent way more time futzing around with the tools than actually working on hardware. This is what Arduino should have been, IMO. Leveraging Visual Studio, .NET MF, and C# was an inspired choice. It puts professional-quality development tools in the hands of hobbyists and startups. This is very cool, and I can't wait to spend more time playing with it. #3384 UART Shield
I use one of the FTDI USB cables that has the FT232R built in.
Works great with the Netduino (make sure to get the 3V3 version). #339 ToggleButton sample
OK, here's my ToggleButton sample from the other thread "Using InterruptPorts".
This is basically like the Event Handlers tutorial on the Projects page. The main difference is that the pushbutton acts like a toggle - push once to turn off the LED, then push again to turn it back on. Another slight modification - the interrupt handler method calls DisableInterrupt() at the start of the method, and EnableInterrupt() at the end. This seems to fix an issue where pressing and holding the button would sometimes cause the LED to change state when the button was released. I think this might be due to switch bounce, so multiple interrupts were getting "stacked up" and handled after the first interrupt method returned. Anyway, here's the code. Let me know if there's interest in posting the entire VS solution. Enjoy! using System; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.Netduino; namespace ToggleButton { public class Program { static bool ledState; static InterruptPort button; static OutputPort led; public static void Main() { // Set the initial state of the LED to on (true). ledState = true; led = new OutputPort(Pins.ONBOARD_LED, ledState); button = new InterruptPort( Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeLow); // Bind the interrupt handler to the pin's interrupt event. button.OnInterrupt += new NativeEventHandler(SwitchInterruptHandler); while (true) { Thread.Sleep(Timeout.Infinite); } } public static void SwitchInterruptHandler(UInt32 data1, UInt32 data2, DateTime time) { button.DisableInterrupt(); // Invert the previous state of the LED. ledState = !ledState; // Set the LED to its new state. led.Write(ledState); // Un-comment the following line if using level interrupts. // button.ClearInterrupt(); button.EnableInterrupt(); } } } #365 ToggleButton sample
Cool, thanks! I've been meaning to try out your emulator. So many projects, so little time... ![]() #343 ToggleButton sample
I haven't tried the Glitch filter yet, thanks for the suggestion. Do you happen to know what the default glitch filter time is (or what value is appropriate to debounce a pushbutton)? #2643 Stay close to your computer (or come to MakerFaire)...
Flying rugs are so old world. I vote for flying cars ![]() #2653 Stay close to your computer (or come to MakerFaire)...
Removing the rest of the evidence
![]() #3131 Stay close to your computer (or come to MakerFaire)...
As a member of the community, I'd be interested in the project to expand the microSD capacity... #2642 Stay close to your computer (or come to MakerFaire)...
Sorry, I'm voluntarily deleting my previous remark, since it was somewhat inappropriate. I don't mean to detract from the Secret Labs announcement.
#3184 Stay close to your computer (or come to MakerFaire)...
Sure. Uuhm, depends on what you mean by "team". ![]() #1403 Soldering Temperature for IC's, etc...
I'd say it also depends a lot on the type of solder you're using.
I learned to solder back when Pb/Sn solder wasn't considered hazardous
![]() ![]() #3292 Serial Comms via USB in the cards?
Pardon my ignorance, but what's CDC (besides the Centers for Disease Control ![]() #3263 SD huh?
Also, it looks like you can just use 128 for the 3rd parameter to FileStream.Read()...if it reads less than 128 bytes, then it should be OK (the method will return the actual number of bytes it read). #1415 Schematic capture software?
Thanks, Szymon. I'll take a look at Fritzing - it looks interesting. #1401 Schematic capture software?
Hi folks,
Some the little sample projects that I've been sharing over on the Project Showcase are getting large enough that it would be helpful to post a schematic along with the code. I expect the circuits will only get bigger as time goes on. ![]() I've been out of the electronics hobby for a while, so I'm curious what kind of schematic capture software is hobbyist-friendly. Basically, this means free (or cheap), and easy to learn. It looks like Eagle supports schematic capture as well as PCB layout, and has a limited freeware version. I've also heard some recommendations for KiCad (open-source). Are there any others I should look into? I'm on the Windows platform, BTW. #167 Reversing the pushbutton state -- feedback?
You can make a good case for either option. I think the real problem is that a Port is fairly generic, while connecting a switch to an input port is a specific use case. A couple of suggestions: 1. Define a new switch-specific enumeration, so that ON corresponds to boolean false, and OFF corresponds to boolean true. 2. Derive a Switch class from the InputPort class, and give the Switch class semantics that make sense for a switch (reading the state as being On/Off, Open/Closed, etc.). Option 1 is probably simpler, while option 2 may be a "next version" type of thing. Thanks, -David #442 Request: New Forum
Sounds good! #309 Request: New Forum
+1 to this suggestion. I think a place to share code and examples would be a good idea.
| ||||||||||||||
![]() |
||||||||||||||
![]() |
|
![]() |
||||||||||||
![]() |
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ![]() |
||||||||||||
![]() |