Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Fenir
- Make walk a dog like robot.
- Wiring :
- ========== ========== ========== ==========
- = 6 = = 7 = = 8 = = 9 =
- ========== ========== ========== ==========
- ===== =====
- = = = =
- = 2 = ========== = 1 =
- = = |ARDUINO | = =
- ===== | | =====
- BACK |BATTERRY| FRONT
- ===== | | =====
- = = | | = =
- = 3 = ========== = 0 =
- = = = =
- ===== =====
- ========== ========== ========== ==========
- = 5 = = 4 = = 11 = = 10 =
- ========== ========== ========== ==========
- servo | PIN
- 1 = 11
- 11 = 10
- 8 = 9
- 3 = 8
- 4 = 7
- 7 = 6
- 2 = 5
- 11 = 4
- 9 = 3
- 6 = 2
- 10 = 1
- 5 = 0
- Coded (Edited/Pasted) by Nathann Morand on 09.2016
- natmo@hotmail.ch
- */
- #include <Servo.h>
- Servo FootRB; // Foot stand for the extremety of the robot
- Servo FootRF; // F for front, L for left
- Servo FootLB; // R for Right and B for Back
- Servo FootLF;
- Servo LegRB;
- Servo LegRF;
- Servo LegLB;
- Servo LegLF;
- Servo ClavicleRB;
- Servo ClavicleRF;
- Servo ClavicleLB;
- Servo ClavicleLF;
- #define FootRBPOSLaydown 0
- #define FootRFPOSLaydown 0
- #define FootLBPOSLaydown 0
- #define FootLFPOSLaydown 0
- #define LegRBPOSLaydown 0
- #define LegRFPOSLaydown 0
- #define LegLBPOSLaydown 0
- #define LegLFPOSLaydown 0
- #define ClavicleRBPOSLaydown 0
- #define ClavicleRFPOSLaydown 0
- #define ClavicleLBPOSLaydown 0
- #define ClavicleLFPOSLaydown 0
- void setup()
- {
- FootRB.attach(5); // attaches the servo on the pin
- FootRF.attach(1);
- FootLB.attach(2);
- FootLF.attach(3);
- LegRB.attach(7);
- LegRF.attach(10);
- LegLB.attach(6);
- LegLF.attach(9);
- ClavicleRB.attach(8);
- ClavicleRF.attach(0);
- ClavicleLB.attach(4);
- ClavicleLF.attach(11);
- }
- void Wake()
- {
- //put the dog in the laydown position if not
- FootRB.write(FootRBPOSLaydown);
- FootRF.write(FootRFPOSLaydown);
- FootLB.write(FootLBPOSLaydown);
- FootLF.write(FootLFPOSLaydown);
- LegRB.write(LegRBPOSLaydown);
- LegRF.write(LegRFPOSLaydown);
- LegLB.write(LegLBPOSLaydown);
- LegLF.write(LegLFPOSLaydown);
- ClavicleRB.write(ClavicleRBPOSLaydown);
- ClavicleRF.write(ClavicleRFPOSLaydown);
- ClavicleLB.write(ClavicleLBPOSLaydown);
- ClavicleLF.write(ClavicleLFPOSLaydown);
- //move the front
- delay(1000);
- FootRF.write(ClavicleLFPOSLaydown -90);
- FootLF.write(ClavicleRFPOSLaydown -90);
- delay(50);
- LegRF.write(LegRFPOSLaydown-90);
- LegLF.write(LegLFPOSLaydown-90);
- /*
- FootLB.write();
- FootRB.write();
- LegRB.write();
- LegRF.write();
- LegLB.write();
- LegLF.write();
- ClavicleRB.write();
- ClavicleRF.write();
- ClavicleLB.write();
- ClavicleLF.write();
- */
- //implémenter le gyroscope, verifier les timing
- }
- void loop()
- {
- Wake();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement