Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00028 #include "nrf24le1.h"
00029 #include "lib_display.h"
00030 #include "hal_delay.h"
00031
00032 void main(void)
00033 {
00034 lib_display_js_states_t js_status = JS_BUTTON_NONE;
00035 lib_display_js_states_t js_status_last = JS_BUTTON_NONE;
00036
00037
00038 lcd_init();
00039
00040
00041 lcd_write_string("Welcome to the", 0, 0);
00042 lcd_write_string("joystick test", 1, 0);
00043
00044
00045 while(js_get_status() == JS_BUTTON_NONE){}
00046
00047 for(;;)
00048 {
00049
00050 js_status = js_get_status();
00051
00052
00053 if( js_status != js_status_last )
00054 {
00055
00056 switch( js_status )
00057 {
00058 case JS_BUTTON_NONE:
00059 lcd_clear();
00060 break;
00061 case JS_BUTTON_PUSH:
00062 lcd_clear();
00063 lcd_write_string("Push", 0, 6);
00064 break;
00065 case JS_BUTTON_RIGHT:
00066 lcd_clear();
00067 lcd_write_string("Right", 0, 11);
00068 break;
00069 case JS_BUTTON_LEFT:
00070 lcd_clear();
00071 lcd_write_string("Left", 0, 0);
00072 break;
00073 case JS_BUTTON_UP:
00074 lcd_clear();
00075 lcd_write_string("Up", 0, 7);
00076 break;
00077 case JS_BUTTON_DOWN:
00078 lcd_clear();
00079 lcd_write_string("Down", 1, 6);
00080 break;
00081 }
00082 js_status_last = js_status;
00083 }
00084 }
00085 }
00086