source: rtos_arduino/trunk/arduino_lib/libraries/Robot_Control/src/utility/scripts_Hello_User.h@ 136

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

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

File size: 1.8 KB
Line 
1#include <avr/pgmspace.h>
2
3//an advanced trick for storing strings inside the program space
4//as the ram of Arduino is very tiny, keeping too many string in it
5//can kill the program
6
7const char hello_user_script1[] PROGMEM="What's your name?";
8const char hello_user_script2[] PROGMEM="Give me a name!";
9const char hello_user_script3[] PROGMEM="And the country?";
10const char hello_user_script4[] PROGMEM="The city you're in?";
11const char hello_user_script5[] PROGMEM=" Plug me to\n\n your computer\n\n and start coding!";
12
13const char hello_user_script6[] PROGMEM=" Hello User!\n\n It's me, your robot\n\n I'm alive! <3";
14const char hello_user_script7[] PROGMEM=" First I need some\n\n input from you!";
15const char hello_user_script8[] PROGMEM=" Use the knob\n\n to select letters";
16const char hello_user_script9[] PROGMEM=" Use L/R button\n\n to move the cursor,\n\n middle to confirm";
17const char hello_user_script10[] PROGMEM=" Press middle key\n to continue...";
18const char hello_user_script11[] PROGMEM=" Choose \"enter\" to\n\n finish the input";
19
20const char * const scripts_Hello_User[] PROGMEM = {
21 hello_user_script1,
22 hello_user_script2,
23 hello_user_script3,
24 hello_user_script4,
25 hello_user_script5,
26 hello_user_script6,
27 hello_user_script7,
28 hello_user_script8,
29 hello_user_script9,
30 hello_user_script10,
31 hello_user_script11,
32};
33
34/*
35void getPGMtext(int seq){
36 //It takes a string from program space, and fill it
37 //in the buffer
38 strcpy_P(buffer,(char*)pgm_read_word(&(scripts[seq])));
39}
40
41void writeScript(int seq, int line, int col){
42 //print a string from program space to a specific line,
43 //column on the LCD
44
45 //first fill the buffer with text from program space
46 getPGMtext(seq);
47 //then print it to the screen
48 textManager.writeText(line,col,buffer);
49}
50
51*/
Note: See TracBrowser for help on using the repository browser.