Hello world, Cerbuino bee

After receiving the FEZ Cerbuino Bee from the Megathon,I decided to do not store it and make my first hello world, I have to say that there is not a lot of specific information about this board because I think is an upgrade of previous versions and the examples are old. Anyway digging a lot I find the way to start working with the pins.

Before start, know that the latest version (VS2012 and .NETMF 4.3) does not work, you need Visual Studio 2010 express and .net microframework 4.2 RTM. Let’s go:

1.- Visual Studio 2010 Express (yes it is still available)

2.- You need the .net microframework 4.2

3.- And you have to register here and download GHI Software Package v4.2

4.- Now install in the same order, it takes me a lot to download everything.

5.- Let’s start Visual Studio, create a new project of .net gadgeeter 4.2

New project
New project

6.- Now in my case, I had to change the default board to the Cerduino Bee, is really easy just drag from the toolbox and it changes the references.

Cerbuino VS
Cerbuino VS

7.- And this is what it takes me more to find out, because the references of pins were not specified at any place, at the end they were in using GHI.OSHW.Hardware. and here the code, now you can access to any of the pins

using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;
using GHI.OSHW.Hardware;
using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Microsoft.SPOT.Hardware;

namespace GadgeteerApp1
{
    public partial class Program
    {
        // This method is run when the mainboard is powered up or reset.
        OutputPort port = null;
        void ProgramStarted()
        {
            GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
                timer.Tick +=new GT.Timer.TickEventHandler(timer_Tick);
                timer.Start();

            port = new OutputPort(FEZCerbuino.Pin.Digital.D0, false);
            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");
        }

        bool ison = true;
        void timer_Tick(GT.Timer timer)
        {
            if (port != null)
            {
                Mainboard.SetDebugLED(ison);
                port.Write(ison);
                ison = !ison;
            }
        }
    }
}

And that’s all now you have the mainboard LED and the external LED ready, they recommend to use the LED with an 100ohm resistor, so my next goal is make an infrared barrier.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s