source: rtos_arduino/trunk/arduino_lib/libraries/Robot_Control/src/helper.cpp@ 136

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

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

File size: 993 bytes
Line 
1#include "ArduinoRobot.h"
2
3void RobotControl::drawBase(){
4 Arduino_LCD::drawCircle(64,80,50,foreGround);
5 Arduino_LCD::drawLine(64,30,64,20,foreGround);
6}
7void 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
27void RobotControl::drawCompass(uint16_t value){
28 drawBase();
29 drawDire(value);
30 debugPrint(value,57,76);
31}
32
33//display logos
34void 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
43void RobotControl::waitContinue(uint8_t key){
44 while(!(Robot.keyboardRead()==key));
45}
Note: See TracBrowser for help on using the repository browser.