Devices & Components
Arduino Nano
Project description
Code
Xenon_Static_Fire_Test_1_Code_.ino
c_cpp
1//Xenon Static Fire 1 (No Feedback)// 2 3#include <Servo.h> 4 5Servo myservo; // create servo object to control a servo 6// twelve servo objects can be created on most boards 7 8int pos = 0; // variable to store the servo position 9 10void setup() { 11 myservo.attach(2); // attaches the servo on pin 9 to the servo object 12 13} 14 15void loop() { 16 for (pos = 11; pos <= 87.5; pos += 1.75) { // goes from 0 degrees to 180 degrees 17 // in steps of 1 degree 18 myservo.write(pos); // tell servo to go to position in variable 'pos' 19 delay(15); // waits 15ms for the servo to reach the position 20 } 21 for (pos = 87.5; pos >= 11; pos -= 1) { // goes from 180 degrees to 0 degrees 22 myservo.write(pos); // tell servo to go to position in variable 'pos' 23 delay(15); // waits 15ms for the servo to reach the position 24 } 25} 26
Downloadable files
Circuit
Circuit

Circuit
Circuit

Comments
Only logged in users can leave comments