
Como fazer um servo 360° PWM a partir de um 180°
Aprenda neste tutorial rápido como converter seus servos 180° em 360° hackeando a placa eletrônica, para usar em seus projetos eletrônicos.
O código
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#include <Servo.h> Servo Servo1; #define potPin A0 #define servoPin 3 void setup() { Serial.begin(9600); Servo1.attach(servoPin); }//endSetup void loop() { Servo1.write(map(analogRead(potPin), 0, 1023, 0, 180)); Serial.print("Angulo: "); Serial.println(map(analogRead(potPin), 0, 1023, 0, 180)); delay(15); }//endLoop |

