Last change
on this file since 376 was 136, checked in by ertl-honda, 9 years ago |
ライブラリとOS及びベーシックなサンプルの追加.
|
File size:
993 bytes
|
Line | |
---|
1 | #include "ArduinoRobot.h"
|
---|
2 |
|
---|
3 | void RobotControl::drawBase(){
|
---|
4 | Arduino_LCD::drawCircle(64,80,50,foreGround);
|
---|
5 | Arduino_LCD::drawLine(64,30,64,20,foreGround);
|
---|
6 | }
|
---|
7 | void RobotControl::drawDire(int16_t dire){
|
---|
8 | static uint8_t x_old;
|
---|
9 | static uint8_t y_old;
|
---|
10 | static uint8_t x_t_old;
|
---|
11 | static uint8_t y_t_old;
|
---|
12 |
|
---|
13 | uint8_t x=60*sin(dire/360.0*6.28)+64;
|
---|
14 | uint8_t x_t=40*sin(dire/360.0*6.28)+64;
|
---|
15 | uint8_t y=60*cos(dire/360.0*6.28)+80;
|
---|
16 | uint8_t y_t=40*cos(dire/360.0*6.28)+80;
|
---|
17 |
|
---|
18 | Arduino_LCD::drawLine(x_t_old,y_t_old,x_old,y_old,backGround);
|
---|
19 | Arduino_LCD::drawLine(x_t,y_t,x,y,RED);
|
---|
20 |
|
---|
21 | x_old=x;
|
---|
22 | y_old=y;
|
---|
23 | x_t_old=x_t;
|
---|
24 | y_t_old=y_t;
|
---|
25 | }
|
---|
26 |
|
---|
27 | void RobotControl::drawCompass(uint16_t value){
|
---|
28 | drawBase();
|
---|
29 | drawDire(value);
|
---|
30 | debugPrint(value,57,76);
|
---|
31 | }
|
---|
32 |
|
---|
33 | //display logos
|
---|
34 | void RobotControl::displayLogos(){
|
---|
35 | _drawBMP("lg0.bmp",0,0);
|
---|
36 | delay(2000);
|
---|
37 | _drawBMP("lg1.bmp",0,0);
|
---|
38 | delay(2000);
|
---|
39 | clearScreen();
|
---|
40 | }
|
---|
41 |
|
---|
42 | //wait for a button to be pressed
|
---|
43 | void RobotControl::waitContinue(uint8_t key){
|
---|
44 | while(!(Robot.keyboardRead()==key));
|
---|
45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.