Beispiel #1
0
 void Servo_set(object sender, EventArgs e)
 {
     ArduinoUno arduino = Manager.arduino;
     //arduino.SetPinMode(ArduinoUnoPins.D9_PWM, PinModes.Servo);
     //arduino.SetPinMode(ArduinoUnoPins.D10_PWM, PinModes.Servo);
     arduino.SetServo(ArduinoUnoPins.D9_PWM, degree);
     arduino.SetServo(ArduinoUnoPins.D10_PWM, degree);
     WaitAnm anm = new WaitAnm(1000);
     anm.AnmFinishedHandler += Servo_off;
     anm.AnmFinishedHandler += DisplayTask;
     anm.Start();
 }
Beispiel #2
0
 void Servo_reset2(object sender, EventArgs e)
 {
     ArduinoUno arduino = Manager.arduino;
     arduino.SetServo(ArduinoUnoPins.D9_PWM, 90);
     arduino.SetServo(ArduinoUnoPins.D10_PWM, 90);
     WaitAnm anm = new WaitAnm(1000);
     anm.AnmFinishedHandler += Servo_set;
     anm.Start();
 }
Beispiel #3
0
        public void GetReady()
        {
            Manager.tDisplay.labelTaskDesc.Text = "準備中";
            Manager.tDisplay.labelLeftMost.Text = "";
            Manager.tDisplay.labelRightMost.Text = "";
            Manager.tDisplay.buttonOK.Enabled = false;
            Manager.tDisplay.trackBarScale.Value = 500;
            Manager.tDisplay.Visible = true;

            WaitAnm anm = new WaitAnm(1000);
            if (!debug)
            {
                Servo_reset();
            //                anm.AnmFinishedHandler += Servo_set;
            }
            else
            {
                anm.AnmFinishedHandler += DisplayTask;
            }
            anm.Start();
        }
Beispiel #4
0
 void Servo_reset()
 {
     ArduinoUno arduino = Manager.arduino;
     arduino.SetPinMode(ArduinoUnoPins.D9_PWM, PinModes.Servo);
     arduino.SetPinMode(ArduinoUnoPins.D10_PWM, PinModes.Servo);
     //arduino.SetServo(ArduinoUnoPins.D9_PWM, 90);
     //arduino.SetServo(ArduinoUnoPins.D10_PWM, 90);
     WaitAnm anm = new WaitAnm(1000);
     anm.AnmFinishedHandler += Servo_reset2;
     anm.Start();
 }
Beispiel #5
0
 protected void Finish()
 {
     Manager.tDisplay.labelTaskDesc.Text = "実験終了!ありがとうございました!";
     Manager.tDisplay.labelLeftMost.Text = "";
     Manager.tDisplay.labelRightMost.Text = "";
     Manager.tDisplay.buttonOK.Enabled = false;
     Manager.tDisplay.trackBarScale.Value = 500;
     Manager.tDisplay.Visible = true;
     WaitAnm anm = new WaitAnm(3000);
     anm.AnmFinishedHandler += close_app;
     anm.Start();
 }