My local GHI distributor told me that the FEZ Panda 2 was end of life and Cerbuino Bee would be its successor. So I ordered some to play with, but I’m having some difficulties :-). I got the firmware update running and am now capable of doing some programming using a new .NET Gadgeteer Application (NETMF 4.2). Nicely done GHI, with the designer and all. I’m impressed. I could easily connect my brand new RFID module and that worked instantly.
However, I missed the 80 IO ports I got so used to on FEZ. So I also bought the IO60P16 to be able to have control myself again and not be forced to use gadgeteer modules (you would give up an entire socket for one button and I need a lot more).
But that is where the problems kicked in. If I use the designer it adds a
Definition. that’s nice. But it has no methods. Instead, it seems that the static IO60P16 now magically knows that it´s bound to this socket. But what if I want to add more IO60P16 modules later on? How would it know what module I refer to when I use a method on GTM.GHIElectronics.IO60P16?
But, I can still live with that for now. I created a small application that sets a multi-color LED to a specific color when I placed a RFID tag. Using output pins on IO60P16 that’s not a problem:
IO60P16.OutputPort ledGreen = null; ledGreen = new IO60P16.OutputPort(IO60P16.IOPin.Port0_Pin1, false);
However, I could not define the ledGreen directly like:
IO60P16.OutputPort ledGreen = new IO60P16.OutputPort(IO60P16.IOPin.Port0_Pin1, false);
So I’ve set it to NULL outside the class and created the instance within ProgramStarted. That works. I could do this for the red, green and blue pin and write true to set it on and false for off.
But…, I wanted to use PWM to dim the Led’s. And that’s where I got another problem. I changed the outputport definitions to PWM definitions:
IO60P16.PWM ledGreen null; ledGreen = new IO60P16.PWM(IO60P16.PWMPin.PWM0, IO60P16.PWM.TickWidth.TickWidth_1500KHz_667ns);
And I could give it a pulse:
The green light does lite up. However, I set red and blue to .SetPulse(0,0) as well. Red and blue are registered on PWM1 and PWM2, green = PWM0. But as soon as I change the pulse setting on any of the PWM ports it seems to affect all of them.
Chances are that I did something truly stupid here, because I’m a complete PWM noob, but I did not expect the PWM ports to affect each other. This was no problem with the output ports.
Any help or pointing in the right direction would be greatly appreciated