2 Replies Latest reply on Feb 22, 2016 10:51 AM by FGT

    How to run servo motor from putty

    AdanChristo

      Hello i successfully connected to my gen 2 board with serial connection, how do i activate servo motor using putty?

       

      i have the C++ code:

       

      #include <Servo.h>
      Servo myservo;
      
      int potpin = 0;
      int val;
      
      void setup() 
      {
        myservo.attach(12);
      
      }
      
      void loop() 
      {
        val = analogRead(potpin);
        val = map(val, 0, 1023, 0, 180);     
        myservo.write(val);                  
        delay(15);
      }