Cerbuino Bee GPIO


I have make 3 small projects for FEZ Panda II.

I was confortable with it.

Somebody told to me that it can be discontinued.

And the socket for the connections will be good for my new project.

 Then i have tryed to use Cerbuino Bee , buy i have this problem.

What´s the method to declare the pins in the socket??

I have tried with.

Cpu.Pin pin = GT.Socket.GetSocket(1, true, null, null).CpuPins[5];

InputPort pin1 = new InputPort(pin, false,Port.ResistorMode.PullUp );

debug.print ( pin1.read().tostring));

 but i can´t register the reads, always return false.

 I have tried too with de Digital inputs with:

 but was no possible.

Can you help me to declare the pins correctly??

thanks in advance


have you stepped through the tutorials for Gadgeteer and the sample code?

Yes Panda II is no longer produced as a regular device, but you can continue to use it with 4.1 framework, and you can still buy the USBizi100/144 chips if you wanted to design your own platform. But if you have no attachment to it there’s no reason you can’t switch, just realise that the Cerb family are open source whereas the Panda is GHI Premium which adds a lot of value.

So an update.

If you check out the developer page, GHI Electronics – Where Hardware Meets Software you can see that Socket 1 Pin 5 is mapped to UART 3 RX and I2C SDA, PB11, so you can actually use D0 as the enumeration. The approach you’re using is the Gadgeteer approach, I haven’t got one of these devices to know if that’s expected to work or not

Actually panda II is being made again and it will be in stock in a week.

@ rlcobos - try something like…


Done on phone so case is all wrong…


Thanks to all,

I have tryed with this class

class PinsCerbuino
public const Cpu.Pin D0 = (Cpu.Pin)0x1B; // PB11/I2C2_SDA/UART3_RX
public const Cpu.Pin D1 = (Cpu.Pin)0x1A; // PB10/I2C2_SCL/SPI2_SCK/UART3_TX
public const Cpu.Pin D2 = (Cpu.Pin)0x1C; // PB12/CAN2_RX
public const Cpu.Pin D3 = (Cpu.Pin)0x2E; // PC14/XO32
public const Cpu.Pin D4 = (Cpu.Pin)0x2F; // PC15/XI32
public const Cpu.Pin D5 = (Cpu.Pin)0x08; // PA8/MC01/PWM
public const Cpu.Pin D6 = (Cpu.Pin)0x0A; // PA10/LOADER1U2/PWM
public const Cpu.Pin D7 = (Cpu.Pin)0x24; // PC4/ADC12_IN14
public const Cpu.Pin D8 = (Cpu.Pin)0x1D; // PB13/SP2_SCK/CAN2_TX/PWM
public const Cpu.Pin D9 = (Cpu.Pin)0x09; // PA9/VBUS
public const Cpu.Pin D10 = (Cpu.Pin)0x0F; // PA15/J_TDI/PWM/SP1_SSEL
public const Cpu.Pin D11 = (Cpu.Pin)0x15; // PB5/CAN2_RX/PWM/SP1_MOSI
public const Cpu.Pin D12 = (Cpu.Pin)0x14; // PB4/J_TRST/PWM/SP1_MISO
public const Cpu.Pin D13 = (Cpu.Pin)0x13; // PB3/J_TDO/PWM/SPI1_SCK

        public const Cpu.Pin A0 = (Cpu.Pin)0x11; // PB1/ADC12_IN9
        public const Cpu.Pin A1 = (Cpu.Pin)0x05; // PA5/SPI1_SCK/ADC12_IN5/DAC2
        public const Cpu.Pin A2 = (Cpu.Pin)0x10; // PB0/ADC12_IN8
        public const Cpu.Pin A3 = (Cpu.Pin)0x23; // PC3/ADC123_IN13/SPI2_MOSI
        public const Cpu.Pin A4 = (Cpu.Pin)0x21; // PC1/ADC123_IN11
        public const Cpu.Pin A5 = (Cpu.Pin)0x04; // PA4/SP1_SSEL/ADC12_IN14/DAC1


and i can use the digital and analogic ports.

but i still can’t using the socket, y have tryied with

var mySocket = Socket.GetSocket(6, true, null, null);
for (var i = 1; i < 10; i++)
Debug.Print(“Socket Number= " + mySocket.Name + " has Socket Pin=” + i + " with assigned CPU PIN=" + mySocket.CpuPins[i].ToString());

//note: -1 means that no CPU PIN is assigned.
Socket Number= 6 has it’s Pin=1 with an assigned CPU PIN=-1
Socket Number= 6 has it’s Pin=2 with an assigned CPU PIN=-1
Socket Number= 6 has it’s Pin=3 with an assigned CPU PIN=18
Socket Number= 6 has it’s Pin=4 with an assigned CPU PIN=20
Socket Number= 6 has it’s Pin=5 with an assigned CPU PIN=22
Socket Number= 6 has it’s Pin=6 with an assigned CPU PIN=10
Socket Number= 6 has it’s Pin=7 with an assigned CPU PIN=36
Socket Number= 6 has it’s Pin=8 with an assigned CPU PIN=38
Socket Number= 6 has it’s Pin=9 with an assigned CPU PIN=35

but i can´t connect with the socket’s pins,

how can i use the CPU PIN number obtained in this bucle, for read the value??

thanks in advance


At the end i can read the socket's pins with.

        Cpu.Pin pin = GT.Socket.GetSocket(3, true, null, null).CpuPins[9];

        InputPort pin1 = new InputPort(pin, false,Port.ResistorMode.PullDown  );

        debug.print pin1.read().tostring();

I don´t know why the firt time i have tryed with this method does not work, i supouse was a problem with mi wires connections.

thanks to all for your interest.

honestly though, that’s not the best way to do it. There are probably cpu.pin enums that you should use instead of bothering to go to such elaborate measures (I can’t point you to them because I don’t have 4.2 installed). Either that, or jump wholly into the gadgeteer model and use it’s socket/pin reservation process (check out a driver for one of the common modules and see how it does it)

@ rlcobos -

_interruptPort = new InterruptPort(GHI.OSHW.Hardware.FEZCerbuino.Pin.Gadgeteer.Socket1.Pin3, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);

Note only pin3 is interrupt capable

All pins are interrupt capable.

@ Gus - Not according to Gadgeteer Spec :smiley:

@ Justin,
The Gadgeteer spec states that [em]atleast[/em] pin 3 will be interrupt capable. It does not say that the rest of the pins are not allowed to be interrupt capable… :slight_smile:

@ GMod(Errol) - i stand corrected…slinking off to the corner of the room…