예제 #1
0
파일: Form1.cs 프로젝트: rjabaker/Skynet
        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;
        }
예제 #2
0
파일: Form1.cs 프로젝트: rjabaker/Skynet
        private void button1_Click(object sender, EventArgs e)
        {
            stopped = !stopped;
            eStop.SetPin(!stopped);

            if (stopped)
            {
                button1.BackColor = Color.Red;
            }
            else
            {
                button1.BackColor = Color.Green;
            }
        }
예제 #3
0
        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);
        }
예제 #4
0
 public void GestureCaptured(bool captured)
 {
     cwAnalogPinMapping.SetPin(captured ? 255 : 0);
     ccwAnalogPinMapping.SetPin(0);
 }
예제 #5
0
파일: Form1.cs 프로젝트: rjabaker/Skynet
 private void ToggleLED(bool on)
 {
     pinMapping.SetPin(on);
 }
예제 #6
0
파일: Form1.cs 프로젝트: rjabaker/Skynet
 private void analogGoButton_Click(object sender, EventArgs e)
 {
     cwAnalogPinMapping.SetPin(Convert.ToInt32(cwAnalogIntensityTextBox.Text));
     ccwAnalogPinMapping.SetPin(Convert.ToInt32(ccwAnalogIntensityTextBox.Text));
 }