exemple d'utilisation de l'IHM NBOARD (IUT Cachan).
Dependencies: IHM_NBOARD mbed
Nboard_IHM.cpp@19:dd7d692f579c, 2018-05-24 (annotated)
- Committer:
- slowness
- Date:
- Thu May 24 08:03:17 2018 +0000
- Revision:
- 19:dd7d692f579c
- Parent:
- 16:c4bfe797dfaf
Nboard May 2018
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 | 15:6d9f90ee99ce | 3 | Serial pc(USBTX, USBRX); // 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 | 15:6d9f90ee99ce | 8 | ihm.LCD_gotoxy(0,1); |
gr66 | 16:c4bfe797dfaf | 9 | pc.printf("Hello IHMV1 \n"); |
gr66 | 12:af99168c1a11 | 10 | ihm.LCD_clear(); |
gr66 | 16:c4bfe797dfaf | 11 | ihm.LCD_gotoxy(0,0); |
gr66 | 16:c4bfe797dfaf | 12 | ihm.LCD_printf("Hello IHM V1"); |
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 | 15:6d9f90ee99ce | 23 | wait(0.5); |
gr66 | 12:af99168c1a11 | 24 | codeur=ihm.COD_read(); |
gr66 | 12:af99168c1a11 | 25 | jog=ihm.JOG_read(); |
gr66 | 12:af99168c1a11 | 26 | ihm.BAR_set((UINT16)(codeur)); |
gr66 | 8:0bbcd33e7811 | 27 | ihm.LCD_gotoxy(0,0); |
gr66 | 12:af99168c1a11 | 28 | ihm.LCD_printf("Jog=%02d",jog); |
gr66 | 8:0bbcd33e7811 | 29 | ihm.LCD_gotoxy(1,0); |
gr66 | 12:af99168c1a11 | 30 | ihm.LCD_printf("Cod=%03d",codeur); |
gr66 | 12:af99168c1a11 | 31 | pc.printf("Jog=%02d Cod=%03d \n",jog,codeur); |
gr66 | 8:0bbcd33e7811 | 32 | } |
gr66 | 8:0bbcd33e7811 | 33 | } |