Last change
on this file since 136 was 136, checked in by ertl-honda, 8 years ago |
ライブラリとOS及びベーシックなサンプルの追加.
|
File size:
530 bytes
|
Rev | Line | |
---|
[136] | 1 | /*
|
---|
| 2 | Turn Test
|
---|
| 3 |
|
---|
| 4 | Check if the robot turns a certain amount of degrees.
|
---|
| 5 |
|
---|
| 6 | Circuit:
|
---|
| 7 | * Arduino Robot
|
---|
| 8 |
|
---|
| 9 | created 1 May 2013
|
---|
| 10 | by X. Yang
|
---|
| 11 | modified 12 May 2013
|
---|
| 12 | by D. Cuartielles
|
---|
| 13 |
|
---|
| 14 | This example is in the public domain
|
---|
| 15 | */
|
---|
| 16 |
|
---|
| 17 | #include <ArduinoRobot.h>
|
---|
| 18 | #include <Wire.h>
|
---|
| 19 | #include <SPI.h>
|
---|
| 20 |
|
---|
| 21 | void setup() {
|
---|
| 22 | // initialize the robot
|
---|
| 23 | Robot.begin();
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | void loop() {
|
---|
| 27 | Robot.turn(50); //turn 50 degrees to the right
|
---|
| 28 | Robot.motorsStop();
|
---|
| 29 | delay(1000);
|
---|
| 30 |
|
---|
| 31 | Robot.turn(-100); //turn 100 degrees to the left
|
---|
| 32 | Robot.motorsStop();
|
---|
| 33 | delay(1000);
|
---|
| 34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.