exemple d'utilisation de l'IHM NBOARD (IUT Cachan).

Dependencies:   IHM_NBOARD mbed

Nboard.cpp

Committer:
gr66
Date:
2016-11-07
Revision:
14:4df60a00f825
Parent:
12:af99168c1a11

File content as of revision 14:4df60a00f825:

#include "IHM.h"
IHM ihm;  //clase IHM
Serial pc(SERIAL_TX, SERIAL_RX);  // I/O terminal PC 
int main()
{
    UINT8 codeur=0,jog;
    float pi=4*atan(1.0);
    ihm.LCD_gotoxy(0,4);
    pc.printf("Hello World  \n");
    ihm.LCD_clear();
    ihm.LCD_gotoxy(0,4);
    ihm.LCD_printf("Hello World      ");
    ihm.LCD_gotoxy(1,0);
    ihm.LCD_printf("PI= %f",pi);  // test affichage float
    ihm.BAR_set(0x3FF);
    wait(2);
    ihm.BAR_set(0x2AA);
    wait(2);
    ihm.BAR_set(0x155);
    wait(2);
    ihm.LCD_clear();
    while(1) {
        wait(2);
        ihm.LCD_gotoxy(1,15);
        ihm.LCD_printf("x");
        ihm.LCD_gotoxy(1,14);
        ihm.LCD_printf("Y");
        wait(2);
        ihm.LCD_gotoxy(1,15);
        ihm.LCD_printf("B");
        codeur=ihm.COD_read();      
        jog=ihm.JOG_read();
        ihm.BAR_set((UINT16)(codeur));
        ihm.LCD_gotoxy(0,0);
        ihm.LCD_printf("Jog=%02d",jog);
        ihm.LCD_gotoxy(1,0);
        ihm.LCD_printf("Cod=%03d",codeur);
        pc.printf("Jog=%02d  Cod=%03d \n",jog,codeur); 
    }
}