private void ArduinoSetup() { ledON = false; toggleLED.BackColor = Color.Red; serialPort = new ArduinoSerialPort("COM5", 115200); serialPort.Open(); cwAnalogPinMapping = new PinMapping(11); ccwAnalogPinMapping = new PinMapping(10); pinMapping = new PinMapping(13); eStop = new PinMapping(8); serialPort.ComponentMappings.Add(cwAnalogPinMapping); serialPort.ComponentMappings.Add(ccwAnalogPinMapping); serialPort.ComponentMappings.Add(pinMapping); serialPort.ComponentMappings.Add(eStop); cwAnalogPinMapping.SetPinMode(SetPinModeStateCodes.OutputStateCode); cwAnalogPinMapping.SetPinMode(SetPinModeStateCodes.OutputStateCode); pinMapping.SetPinMode(SetPinModeStateCodes.OutputStateCode); eStop.SetPinMode(SetPinModeStateCodes.OutputStateCode); pinMapping.FeedbackEvent += new SkynetUtilities.FeedbackRecievedEventHandler(ResponsePackageRecieved); this.replyPackageTextBox.Text = "0"; eStop.SetPin(true); stopped = false; }
public void CreateEmergencyStop() { // RBakerFlag -> This should be in a "reserved pins" settings file. // Or even a pin profile. emergencyStop = new PinMapping(8); arduinoSerialPort.ComponentMappings.Add(emergencyStop); emergencyStop.SetPinMode(SetPinModeStateCodes.OutputStateCode); emergencyStop.SetPin(true); }
public void LoadJointProfiles() { // RBakerFlag -> TEST CODE! PinMapping cw = new PinMapping(9, "clockwise"); PinMapping ccw = new PinMapping(10, "anti-clockwise"); arduinoSerialPort.ComponentMappings.Add(cw); arduinoSerialPort.ComponentMappings.Add(ccw); cw.SetPinMode(SetPinModeStateCodes.OutputStateCode); ccw.SetPinMode(SetPinModeStateCodes.OutputStateCode); Joint joint = new Joint(cw, ccw, JointType.ElbowRight); joints.Add(joint); }
public void InitializeArduino() { serialPort = new ArduinoSerialPort("COM5", 115200); serialPort.Open(); cwAnalogPinMapping = new PinMapping(11); ccwAnalogPinMapping = new PinMapping(10); eStop = new PinMapping(8); serialPort.ComponentMappings.Add(cwAnalogPinMapping); serialPort.ComponentMappings.Add(ccwAnalogPinMapping); serialPort.ComponentMappings.Add(eStop); cwAnalogPinMapping.SetPinMode(SetPinModeStateCodes.OutputStateCode); cwAnalogPinMapping.SetPinMode(SetPinModeStateCodes.OutputStateCode); eStop.SetPinMode(SetPinModeStateCodes.OutputStateCode); eStop.SetPin(true); }