Advertisement
flyingfisch

Untitled

May 14th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.80 KB | None | 0 0
  1. #include <display_syscalls.h>
  2. #include <keyboard_syscalls.h>
  3. #include <display_syscalls.h>
  4. #include <keyboard_syscalls.h>
  5. #include <display_syscalls.h>
  6. #include <display.h>
  7. #include <keyboard.hpp>
  8. #include <color.h>
  9. #include <RTC_syscalls.h>
  10. #include <CONVERT_syscalls.h>
  11.  
  12. void plot(int x0, int y0, int color);
  13.  
  14.  
  15. int main() {
  16.     int key;
  17.     int msg = 1;
  18.     int done = 0;
  19.    
  20.     while(!done) {
  21.         PrintXY_2(TEXT_MODE_NORMAL, 1, 1, msg, TEXT_COLOR_BLACK);
  22.        
  23.         char buffer[10];
  24.         strcpy(buffer,"  ");
  25.         itoa(msg, buffer+2);
  26.        
  27.         PrintXY( 1, 2, buffer, TEXT_MODE_NORMAL, TEXT_COLOR_BLACK);
  28.         Bdisp_PutDisp_DD();
  29.         key = PRGM_GetKey();
  30.        
  31.         switch(key) {
  32.             case KEY_PRGM_UP:
  33.             msg = 1+msg;
  34.             break;
  35.            
  36.             case KEY_PRGM_DOWN:
  37.             msg = 1-msg;
  38.             break;
  39.            
  40.             case KEY_PRGM_MENU:
  41.             done = 1;
  42.             break;
  43.         }
  44.     }
  45.    
  46.  
  47.     return 1;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement