Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ARami7
New Contributor I
909 Views

How to run servo motor from putty

Jump to solution

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 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);

}


Accepted Solutions
Diego_V_Intel
Employee
69 Views

Hi AdanChristo,

That code seems to be an Arduino sketch. If so, you should upload the sketch to the board using the Arduino IDE and it will start running automatically. There is no need to access the terminal through PuTTY.

Regards,

Diego

View solution in original post

2 Replies
Diego_V_Intel
Employee
70 Views

Hi AdanChristo,

That code seems to be an Arduino sketch. If so, you should upload the sketch to the board using the Arduino IDE and it will start running automatically. There is no need to access the terminal through PuTTY.

Regards,

Diego

View solution in original post

FTinetti
Honored Contributor I
69 Views

Hi AdanChristo,

Your sketch moves the servo according to the analog value read at analog pin 0.

What do you mean by

how do i activate servo motor using putty?

? Please give describe what you are trying to do.

Fernando.

Reply