I’m a newbie and have been struggling with getting a simple example to run.
I was trying to run the example from GHI using display, camera and button but
couldn’t get any results so I stripped out the camera and display and now am just
trying to get a simple button to toggle led on/off.
I did add a 9v 800ma power supply in addition to the usb so running in dual power.
You can see my simple code in the image - basically, in the ProgramStarted function, I
only set up the buttonPressed event and do a debug print:
button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
Here are the strange things I see:
- I never see “Hello” printed on the output as I would expect.
- I always see “Program Started” (I’ve cleaned and rebuilt the project, don’t know where this message comes from)
- When I run (F5), the button_ButtonPressed function always gets called once (I have a break point) , even though I did not press the button. After the breakpoint, I continue so the program is running.
- after I see program started, I press the button several (many) times but the function ButtonPressed is never called (ie never get breakpoint, and if I remove breakpoint, never see led toggle on the button module anyway).
And, even though the ButtonPressed function is called once during the program start (for some unknown reason), still don’t see led toggle and do not see debug output message
So, it seems like the software just doesn’t run correctly. I’m hoping to get another power supply (12v, 1a), but with just a button module connected, I doubt this is the problem as the power led is pretty bright.
Please look at the attached image and I’m hoping someone has some ideas…
Thanks very much!!