exemple d'utilisation de l'IHM NBOARD (IUT Cachan).
Dependencies: IHM_NBOARD mbed
Nboard.cpp@14:4df60a00f825, 2016-11-07 (annotated)
- Committer:
- gr66
- Date:
- Mon Nov 07 09:31:27 2016 +0000
- Revision:
- 14:4df60a00f825
- Parent:
- 12:af99168c1a11
V1.1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gr66 | 8:0bbcd33e7811 | 1 | #include "IHM.h" |
gr66 | 12:af99168c1a11 | 2 | IHM ihm; //clase IHM |
gr66 | 12:af99168c1a11 | 3 | Serial pc(SERIAL_TX, SERIAL_RX); // I/O terminal PC |
gr66 | 8:0bbcd33e7811 | 4 | int main() |
gr66 | 8:0bbcd33e7811 | 5 | { |
gr66 | 12:af99168c1a11 | 6 | UINT8 codeur=0,jog; |
gr66 | 8:0bbcd33e7811 | 7 | float pi=4*atan(1.0); |
gr66 | 12:af99168c1a11 | 8 | ihm.LCD_gotoxy(0,4); |
gr66 | 11:7cfa7c991676 | 9 | pc.printf("Hello World \n"); |
gr66 | 12:af99168c1a11 | 10 | ihm.LCD_clear(); |
gr66 | 12:af99168c1a11 | 11 | ihm.LCD_gotoxy(0,4); |
gr66 | 8:0bbcd33e7811 | 12 | ihm.LCD_printf("Hello World "); |
gr66 | 8:0bbcd33e7811 | 13 | ihm.LCD_gotoxy(1,0); |
gr66 | 8:0bbcd33e7811 | 14 | ihm.LCD_printf("PI= %f",pi); // test affichage float |
gr66 | 8:0bbcd33e7811 | 15 | ihm.BAR_set(0x3FF); |
gr66 | 8:0bbcd33e7811 | 16 | wait(2); |
gr66 | 8:0bbcd33e7811 | 17 | ihm.BAR_set(0x2AA); |
gr66 | 8:0bbcd33e7811 | 18 | wait(2); |
gr66 | 8:0bbcd33e7811 | 19 | ihm.BAR_set(0x155); |
gr66 | 8:0bbcd33e7811 | 20 | wait(2); |
gr66 | 8:0bbcd33e7811 | 21 | ihm.LCD_clear(); |
gr66 | 8:0bbcd33e7811 | 22 | while(1) { |
gr66 | 14:4df60a00f825 | 23 | wait(2); |
gr66 | 14:4df60a00f825 | 24 | ihm.LCD_gotoxy(1,15); |
gr66 | 14:4df60a00f825 | 25 | ihm.LCD_printf("x"); |
gr66 | 14:4df60a00f825 | 26 | ihm.LCD_gotoxy(1,14); |
gr66 | 14:4df60a00f825 | 27 | ihm.LCD_printf("Y"); |
gr66 | 14:4df60a00f825 | 28 | wait(2); |
gr66 | 14:4df60a00f825 | 29 | ihm.LCD_gotoxy(1,15); |
gr66 | 14:4df60a00f825 | 30 | ihm.LCD_printf("B"); |
gr66 | 12:af99168c1a11 | 31 | codeur=ihm.COD_read(); |
gr66 | 12:af99168c1a11 | 32 | jog=ihm.JOG_read(); |
gr66 | 12:af99168c1a11 | 33 | ihm.BAR_set((UINT16)(codeur)); |
gr66 | 8:0bbcd33e7811 | 34 | ihm.LCD_gotoxy(0,0); |
gr66 | 12:af99168c1a11 | 35 | ihm.LCD_printf("Jog=%02d",jog); |
gr66 | 8:0bbcd33e7811 | 36 | ihm.LCD_gotoxy(1,0); |
gr66 | 12:af99168c1a11 | 37 | ihm.LCD_printf("Cod=%03d",codeur); |
gr66 | 12:af99168c1a11 | 38 | pc.printf("Jog=%02d Cod=%03d \n",jog,codeur); |
gr66 | 8:0bbcd33e7811 | 39 | } |
gr66 | 8:0bbcd33e7811 | 40 | } |