source: rtos_arduino/trunk/arduino_lib/libraries/Braccio/examples/simpleMovements/simpleMovements.ino@ 175

Last change on this file since 175 was 175, checked in by ertl-honda, 8 years ago

ライブラリを Arduino IDE 1.7.9 にupdate

File size: 1.5 KB
Line 
1
2/*
3 simpleMovements.ino
4
5 This sketch simpleMovements shows how they move each servo motor of Braccio
6
7 Created on 18 Nov 2015
8 by Andrea Martino
9
10 This example is in the public domain.
11 */
12
13#include <Braccio.h>
14#include <Servo.h>
15
16Servo base;
17Servo shoulder;
18Servo elbow;
19Servo wrist_rot;
20Servo wrist_ver;
21Servo gripper;
22
23void setup() {
24 //Initialization functions and set up the initial position for Braccio
25 //All the servo motors will be positioned in the "safety" position:
26 //Base (M1):90 degrees
27 //Shoulder (M2): 45 degrees
28 //Elbow (M3): 180 degrees
29 //Wrist vertical (M4): 180 degrees
30 //Wrist rotation (M5): 90 degrees
31 //gripper (M6): 10 degrees
32 Braccio.begin();
33}
34
35void loop() {
36 /*
37 Step Delay: a milliseconds delay between the movement of each servo. Allowed values from 10 to 30 msec.
38 M1=base degrees. Allowed values from 0 to 180 degrees
39 M2=shoulder degrees. Allowed values from 15 to 165 degrees
40 M3=elbow degrees. Allowed values from 0 to 180 degrees
41 M4=wrist vertical degrees. Allowed values from 0 to 180 degrees
42 M5=wrist rotation degrees. Allowed values from 0 to 180 degrees
43 M6=gripper degrees. Allowed values from 10 to 73 degrees. 10: the toungue is open, 73: the gripper is closed.
44 */
45
46 //(step delay, M1, M2, M3, M4, M5, M6);
47 Braccio.ServoMovement(20, 0, 15, 180, 170, 0, 73);
48
49 //Wait 1 second
50 delay(1000);
51
52 Braccio.ServoMovement(20, 180, 165, 0, 0, 180, 10);
53
54 //Wait 1 second
55 delay(1000);
56}
Note: See TracBrowser for help on using the repository browser.