Last change
on this file since 136 was 136, checked in by ertl-honda, 9 years ago |
ライブラリとOS及びベーシックなサンプルの追加.
|
File size:
838 bytes
|
Rev | Line | |
---|
[136] | 1 | /* 6 Wheel Calibration
|
---|
| 2 | *
|
---|
| 3 | * Use this sketch to calibrate the wheels in your robot.
|
---|
| 4 | * Your robot should drive as straight as possible when
|
---|
| 5 | * putting both motors at the same speed.
|
---|
| 6 | *
|
---|
| 7 | * Run the software and follow the on-screen instructions.
|
---|
| 8 | * Use the trimmer on the bottom board to make sure the
|
---|
| 9 | * robot is working at its best!
|
---|
| 10 | *
|
---|
| 11 | * (c) 2013 X. Yang
|
---|
| 12 | */
|
---|
| 13 | #include "scripts_library.h"
|
---|
| 14 |
|
---|
| 15 | #include <ArduinoRobot.h>
|
---|
| 16 | #include <Wire.h>
|
---|
| 17 | #include <SPI.h>
|
---|
| 18 |
|
---|
| 19 | void setup() {
|
---|
| 20 | Serial.begin(9600);
|
---|
| 21 | Robot.begin();
|
---|
| 22 | Robot.beginTFT();
|
---|
| 23 | Robot.beginSD();
|
---|
| 24 |
|
---|
| 25 | Robot.setTextWrap(false);
|
---|
| 26 | Robot.displayLogos();
|
---|
| 27 |
|
---|
| 28 | writeAllScripts();
|
---|
| 29 |
|
---|
| 30 | }
|
---|
| 31 | void loop() {
|
---|
| 32 | int val = map(Robot.knobRead(), 0, 1023, -255, 255);
|
---|
| 33 | Serial.println(val);
|
---|
| 34 | Robot.motorsWrite(val, val);
|
---|
| 35 |
|
---|
| 36 | int WC = map(Robot.trimRead(), 0, 1023, -20, 20);
|
---|
| 37 | Robot.debugPrint(WC, 108, 149);
|
---|
| 38 | delay(40);
|
---|
| 39 |
|
---|
| 40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.