Windows IoT - Status Board
I found a really cool "Hat" for the Raspberry Pi on https://thepihut.com called "Status Board" There is a 5 line version for Pi2/3 and a 3 line version for the Pi Zero. It's fairly simple, uses just the GPIO so I thought it would be a good place to write some code for Windows IoT.The expectation is that most users will just use the Python library that is available, so there isn't much technical documentation. On the back side of the board the GPIO are listed by function "Breakout", "Button" and "LED" that's literally it. For example it doesn't specify which pin for which line or red/green. Also no mention of Hi/Lo Pullup/Pulldown etc. This doesn't make the job impossible, but it would of been nice.
Nuances\Gotchas:
- Pin 14, 15 are reserved in Windows IoT but are used so line 1 and 3 buttons don't work.
- Pin 4, 17 doesn't work like I expected, so line one LED's don't work (red or green)
- Pin 19 doesn't work like I expected, so line 2 button doesn't work.
To be fair the issues on Pins 4, 17, 19 could be something wrong with my solder work or an issue on the Pi2 that I'm using, so I left the appropriate code for these functions, it just doesn't do anything for me.
Result was a little disappointing:
Line one: Nothing works
Line two: LED's work, No button
Line three: LED's work, No button
Line four: LED's work, Button works
Line five: LED's work, Button works
Personally I probably won't use these boards for my robot project, the LED's are "indoor" bright but my robot is intended for outdoor use.
I've attached my source code below which may be useful for someone to learn from.
Here is an example of how to use it:
PiStatus piStatus = new PiStatus("Testing", 5);
piStatus.Buttons[1].ValueChanged += StartupTask_ValueChanged; // Doesn't work for me
piStatus.Buttons[3].ValueChanged += StartupTask_ValueChanged;
piStatus.Buttons[4].ValueChanged += StartupTask_ValueChanged;
piStatus.SetLED(0, LEDColor.Green); // Doesn't work for me
piStatus.SetLED(1, LEDColor.Green);
piStatus.SetLED(2, LEDColor.Green);
piStatus.SetLED(3, LEDColor.Green);
piStatus.SetLED(4, LEDColor.Green);
piStatus.SetLED(0, LEDColor.Off);
piStatus.SetLED(1, LEDColor.Off);
piStatus.SetLED(2, LEDColor.Off);
piStatus.SetLED(3, LEDColor.Off);
piStatus.SetLED(4, LEDColor.Off);
piStatus.SetLED(0, LEDColor.Red); // Doesn't work for me
piStatus.SetLED(1, LEDColor.Red);
piStatus.SetLED(2, LEDColor.Red);
piStatus.SetLED(3, LEDColor.Red);
piStatus.SetLED(4, LEDColor.Red);

No comments:
Post a Comment