Give this project a try for yourself! Get the BOM. Int potentio = A0 // initialize the A0analog pin for potentiometerĪngle = analogRead(potentio) // reading the potentiometer value between Īngle = map(angle, 0, 1023, 0, 179) // scaling the potentiometer value to angle value for servo between 0 and 180) Once the program is started, rotating the potentiometer should cause the shaft of the servo motor to rotate.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |