getting used to coding and all that can be achieved with gadgeteer, wondered if you can point me to some good step by step guides?
I have been working through the ‘camera’ that seems to be a start point for most people but want to learn coding before I spend lots on components. can anyone help?
using System;
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 Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
namespace workyougit
{
public partial class Program
{
// This method is run when the mainboard is powered up or reset.
Gadgeteer.Modules.GHIElectronics.LED7R led7r;
Gadgeteer.Modules.GHIElectronics.Button button;
void ProgramStarted()
{
button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
//LED7R = Button.LEDModes.OnWhilePressed;
led7r.TurnLightOn(14, false);
}
void button_ButtonPressed(Button sender, Button.ButtonState state)
{
Debug.Print("Button has been Pressed");
}
}
}
up loaded this code and it runs but does not function. ie LED does not turn on, yes I am an absolute beginner, please help…
Connect 7 led module and button using visual designer.
Try something like this:
public partial class Program
{
void ProgramStarted()
{
button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
}
int led = 0
void button_ButtonPressed(Button sender, Button.ButtonState state)
{
led = (led+1)%7;
led7r.TurnLightOn(led,true);
}
}
namespace GadgeteerApp1
{
public partial class Program
{
// This method is run when the mainboard is powered up or reset.
void ProgramStarted()
{
Debug.Print("button pressed");
led.TurnBlue();
Debug.Print("Program Started");
}
}
}
I am only trying to do some really simple stuff but this keeps coming up.
System.Exception’ occurred in Microsoft.SPOT.Hardware.dll
I am using a 17inch macbook pro running windows 7 all kits updated… very strange, can you help?
Rob, sounds like firmware version to me. Check your version, show us the output of the MFDeploy Device Capabilities, and coinfirm what SDK version you have installed (the README in the GHI directory)