namespace ServoDriver
{
public partial class Program
{
// This method is run when the mainboard is powered up or reset.
private static SerialServoController servoController;
// Gadgeteer.Interfaces.Serial serialPort;
void ProgramStarted()
{
SerialPort serialPort = new SerialPort("COM2", 9600, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.None);
servoController = new SerialServoController(serialPort);
servoController.GoHome();
Debug.Print("Program Started");
}
}
}
I’ve tried a few things and I’m still not able to get the mini maestro to work, I was hoping someone might spot my mistake.
My schematic is attached and this is the code I’m using. I’m using socket 7 on the hydra. Thank you.
using System;
using System.IO.Ports;
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 Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Ahmed.Micro.Contollers.Maestro;
using Ahmed.Micro.Contollers.Maestro.Variables;
using Gadgeteer.Modules.GHIElectronics;
namespace ServoDriver
{
public partial class Program
{
// This method is run when the mainboard is powered up or reset.
private static SerialServoController servoController;
// Gadgeteer.Interfaces.Serial serialPort;
void ProgramStarted()
{
Debug.Print("Started");
SerialPort serialPort = new SerialPort("COM2", 9600, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);
servoController = new SerialServoController(serialPort);
servoController.GoHome();
button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
}
void button_ButtonPressed(Button sender, Button.ButtonState state)
{
Debug.Print("Pressed");
servoController.SetTarget(0, 1040);
}
}
}