I have Cerberus and connect on 7 port LED7R. I want through method “Digital Outputs” Light Up an LED.
I saw lesson https://www.ghielectronics.com/docs/7/digital-outputs, but does not work.
Name Pin on board: PC4
Module LED7R: PC9
Code:
OutputPort LED;
LED = new OutputPort(Pin.PC4, true);
//LED = new OutputPort(Pin.PC9, true);
while (true)
{
LED.Write(true);
Thread.Sleep(200);
Can I ask why you’re making this first project so hard? One of the Gadgeteer benefits is you don’t need to know this stuff.
Create a new project - select a Gadgeteer project.
Drag a Cerberus mainboard in or choose it as part of the setup.
Drag a LED7R from the toolbox.
Wire the 7R to the Cerb on a valid port.
In your code, use the TurnLightOn() method to enable a light.
That will prove everything you have connected is working.
Then you can get into a project that uses digital input/output separately, but you’ve proven everything that you have is working as expected.
From the code for the module, you can see that the LEDs are on pins 3 through 9. so you can try setting all those on, waiting some time, setting them all off again, to prove that this works. My cerb had an accident yesterday so I can’t prove that, but here’s how I tested…
Create new project, a netmf console project.
Change target framework to 4.2 (since I’m using VS2012)
Add references to GHI.Hardware.FezCerb, GHI.OSHW.Hardware, Microsoft.SPOT.Hardware.
Then in main() I simply declared some output port pins:
OutputPort LED_a = new OutputPort(GHI.Hardware.FEZCerb.Pin.PA15, false);
OutputPort LED_b = new OutputPort(GHI.Hardware.FEZCerb.Pin.PC8, false);
OutputPort LED_c = new OutputPort(GHI.Hardware.FEZCerb.Pin.PC9,false);