Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // C++ code
- //
- #include <Servo.h>
- Servo servo_1;
- Servo servo_2;
- Servo servo_3;
- Servo servo_4;
- Servo servo_5;
- int WiggleCnt = 3;
- int LoopCnt;
- void setup() {
- servo_1.attach(1, 500, 2500);
- servo_2.attach(2, 500, 2500);
- servo_3.attach(3, 500, 2500);
- servo_4.attach(4, 500, 2500);
- servo_5.attach(5, 500, 2500);
- for (LoopCnt = 0; LoopCnt < WiggleCnt; ++LoopCnt) {
- delay(1000);
- servo_1.write(150);
- delay(1000);
- servo_1.write(0);
- }
- servo_1.write(150);
- delay(2000);
- for (LoopCnt = 0; LoopCnt < WiggleCnt; ++LoopCnt) {
- delay(1000);
- servo_2.write(150);
- delay(1000);
- servo_2.write(30);
- }
- servo_2.write(150);
- delay(2000);
- for (LoopCnt = 0; LoopCnt < WiggleCnt; ++LoopCnt) {
- delay(1000);
- servo_3.write(180);
- delay(1000);
- servo_3.write(30);
- }
- servo_3.write(180);
- delay(2000);
- for (LoopCnt = 0; LoopCnt < WiggleCnt; ++LoopCnt) {
- delay(1000);
- servo_4.write(180);
- delay(1000);
- servo_4.write(30);
- }
- servo_4.write(180);
- delay(2000);
- for (LoopCnt = 0; LoopCnt < WiggleCnt; ++LoopCnt) {
- delay(1000);
- servo_5.write(180);
- delay(1000);
- servo_5.write(30);
- }
- servo_5.write(180);
- }
- void loop() {
- }
Advertisement
Add Comment
Please, Sign In to add comment