source: rtos_arduino/trunk/arduino_lib/libraries/Robot_Control/examples/explore/R06_Wheel_Calibration/scripts_library.h@ 136

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

ライブラリとOS及びベーシックなサンプルの追加.

File size: 1.0 KB
Line 
1#include <avr/pgmspace.h>
2#include <ArduinoRobot.h>
3
4const char script1[] PROGMEM="Wheel Calibration\n";
5const char script2[] PROGMEM="1. Put Robot on a flat surface\n";
6const char script3[] PROGMEM="2. Adjust speed with the knob on top\n";
7const char script4[] PROGMEM="3. If robot goes straight, it's done\n";
8const char script5[] PROGMEM="4. Use screwdriver on the trim on bottom\n";
9const char script6[] PROGMEM="Robot turns left, screw it clockwise;\n";
10const char script7[] PROGMEM="Turns right, screw it ct-colockwise;\n";
11const char script8[] PROGMEM="5. Repeat 4 until going straight\n";
12
13char buffer[42];//must be longer than text
14
15const char * const scripts[] PROGMEM = {
16 script1,
17 script2,
18 script3,
19 script4,
20 script5,
21 script6,
22 script7,
23 script8,
24};
25
26void getPGMtext(int seq){
27 strcpy_P(buffer,(char*)pgm_read_word(&(scripts[seq])));
28}
29
30void writePGMtext(int seq){
31 getPGMtext(seq);
32 Robot.print(buffer);
33}
34
35void writeScript(int seq){
36 writePGMtext(seq);
37}
38
39void writeAllScripts(){
40 for(int i=0;i<8;i++){
41 writeScript(i);
42 }
43}
Note: See TracBrowser for help on using the repository browser.