Quentin LAM
/
ex17
Exo
Nboard.cpp@8:0bbcd33e7811, 2016-09-30 (annotated)
- Committer:
- gr66
- Date:
- Fri Sep 30 22:01:44 2016 +0000
- Revision:
- 8:0bbcd33e7811
- Child:
- 10:4c838a5a5e42
Exemple avec lib IHM V0.1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gr66 | 8:0bbcd33e7811 | 1 | #include "IHM.h" |
gr66 | 8:0bbcd33e7811 | 2 | |
gr66 | 8:0bbcd33e7811 | 3 | IHM ihm; |
gr66 | 8:0bbcd33e7811 | 4 | Serial pc(SERIAL_TX, SERIAL_RX); |
gr66 | 8:0bbcd33e7811 | 5 | |
gr66 | 8:0bbcd33e7811 | 6 | int main() |
gr66 | 8:0bbcd33e7811 | 7 | { |
gr66 | 8:0bbcd33e7811 | 8 | unsigned char i=0,j; |
gr66 | 8:0bbcd33e7811 | 9 | float pi=4*atan(1.0); |
gr66 | 8:0bbcd33e7811 | 10 | pc.printf("debut"); |
gr66 | 8:0bbcd33e7811 | 11 | ihm.LCD_printf("Hello World "); |
gr66 | 8:0bbcd33e7811 | 12 | ihm.LCD_gotoxy(1,0); |
gr66 | 8:0bbcd33e7811 | 13 | ihm.LCD_printf("PI= %f",pi); // test affichage float |
gr66 | 8:0bbcd33e7811 | 14 | ihm.BAR_set(0x3FF); |
gr66 | 8:0bbcd33e7811 | 15 | wait(2); |
gr66 | 8:0bbcd33e7811 | 16 | ihm.BAR_set(0x2AA); |
gr66 | 8:0bbcd33e7811 | 17 | wait(2); |
gr66 | 8:0bbcd33e7811 | 18 | ihm.BAR_set(0x155); |
gr66 | 8:0bbcd33e7811 | 19 | wait(2); |
gr66 | 8:0bbcd33e7811 | 20 | ihm.LCD_clear(); |
gr66 | 8:0bbcd33e7811 | 21 | while(1) { |
gr66 | 8:0bbcd33e7811 | 22 | wait(0.1); |
gr66 | 8:0bbcd33e7811 | 23 | printf("cod"); |
gr66 | 8:0bbcd33e7811 | 24 | i=ihm.COD_read(); |
gr66 | 8:0bbcd33e7811 | 25 | |
gr66 | 8:0bbcd33e7811 | 26 | j=ihm.JOG_read(); |
gr66 | 8:0bbcd33e7811 | 27 | ihm.BAR_set((UINT16)(i)); |
gr66 | 8:0bbcd33e7811 | 28 | ihm.LCD_gotoxy(0,0); |
gr66 | 8:0bbcd33e7811 | 29 | ihm.LCD_printf("Jog=%02d",j); |
gr66 | 8:0bbcd33e7811 | 30 | ihm.LCD_gotoxy(1,0); |
gr66 | 8:0bbcd33e7811 | 31 | ihm.LCD_printf("Cod=%03d",i); |
gr66 | 8:0bbcd33e7811 | 32 | // a=robot.bp(0); |
gr66 | 8:0bbcd33e7811 | 33 | // b=robot.bp(1); |
gr66 | 8:0bbcd33e7811 | 34 | // c=robot.bp(2); |
gr66 | 8:0bbcd33e7811 | 35 | // d=robot.bp(3); |
gr66 | 8:0bbcd33e7811 | 36 | // robot.led(i); |
gr66 | 8:0bbcd33e7811 | 37 | // robot.LCD_gotoxy(1,0); |
gr66 | 8:0bbcd33e7811 | 38 | // robot.LCD_printf("B0=%dB1=%dB2=%dB3=%d",a,b,c,d); |
gr66 | 8:0bbcd33e7811 | 39 | //pc.printf("jog %d \n",j); |
gr66 | 8:0bbcd33e7811 | 40 | } |
gr66 | 8:0bbcd33e7811 | 41 | } |
gr66 | 8:0bbcd33e7811 | 42 | |
gr66 | 8:0bbcd33e7811 | 43 | |
gr66 | 8:0bbcd33e7811 | 44 | |
gr66 | 8:0bbcd33e7811 | 45 |