Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NBoard_IHM_V2 ex20_fonction ex21_PWM1 ex26 ... more
Fork of IHM_V2 by
Revision 1:663cbe5baac4, committed 2016-11-05
- Comitter:
- gr66
- Date:
- Sat Nov 05 17:19:59 2016 +0000
- Parent:
- 0:cd0f9e8c609b
- Child:
- 2:ba3449b7e070
- Child:
- 3:ccd7c3d1024d
- Commit message:
- V00
Changed in this revision
| IHM.cpp | Show annotated file Show diff for this revision Revisions of this file |
| IHM.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/IHM.cpp Sat Oct 01 12:23:41 2016 +0000
+++ b/IHM.cpp Sat Nov 05 17:19:59 2016 +0000
@@ -90,9 +90,9 @@
/* PARAMETER 1 : UINT8 x : indice de la ligne (0 à 1) */
/* PARAMETER 2 : UINT8 y : indice de la colonne (0 à 15) */
/****************************************************************************************/
-void IHM::LCD_gotoxy (UINT8 x, UINT8 y)
+void IHM::LCD_gotoxy (UINT8 y, UINT8 x)
{
- curseur=(x*16+y)%32;
+ curseur=(y*16+x)%32;
}
--- a/IHM.h Sat Oct 01 12:23:41 2016 +0000
+++ b/IHM.h Sat Nov 05 17:19:59 2016 +0000
@@ -1,4 +1,4 @@
-/// @file IHM.h Bibliothéque de classe pour la carte Zboard
+/// @file IHM.h Bibliothéque de classe pour la carte l'IHM de la carte NBoard
/// @mainpage
///
///
@@ -7,7 +7,7 @@
///
/// @note
/// History
-/// v1.00 01/10/2016
+/// v2.00 05/11/2016
#include "all_includes.h"
#define SIZE_FIFO 32
#define MESSAGE_BUFFER_SIZE 20
@@ -16,24 +16,23 @@
#define JOG_MSK_UP (1<<3) // valeur renvoyée si le Jog est poussé vers le haut (non enfoncé).
#define JOG_MSK_LEFT (1<<1) // valeur renvoyée si le Jog est poussé vers la gauche (non enfoncé).
#define JOG_MSK_DOWN 1 // valeur renvoyée si le Jog est poussé vers le bas (non enfoncé).
-
-//static char tableau_ecran[32]= {32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32};
-
//
///
/// Example:
/// @code
+
///#include "IHM.h"
-///IHM ihm;
-///Serial pc(SERIAL_TX, SERIAL_RX);
+///IHM ihm; //clase IHM
+///Serial pc(SERIAL_TX, SERIAL_RX); // I/O terminal PC
///int main()
///{
-/// unsigned char i=0,j;
+/// unsigned char codeur=0,jog;
/// float pi=4*atan(1.0);
-/// pc.printf("debut");
+/// pc.printf("Hello World \n");
+/// ihm.LCD_clear();
/// ihm.LCD_printf("Hello World ");
/// ihm.LCD_gotoxy(1,0);
- /// ihm.LCD_printf("PI= %f",pi); // test affichage float
+/// ihm.LCD_printf("PI= %f",pi); // test affichage float
/// ihm.BAR_set(0x3FF);
/// wait(2);
/// ihm.BAR_set(0x2AA);
@@ -43,14 +42,14 @@
/// ihm.LCD_clear();
/// while(1) {
/// wait(0.1);
-/// printf("cod");
-/// i=ihm.COD_read();
-/// j=ihm.JOG_read();
-/// ihm.BAR_set((UINT16)(i));
+/// codeur=ihm.COD_read();
+/// jog=ihm.JOG_read();
+/// ihm.BAR_set((UINT16)(codeur));
/// ihm.LCD_gotoxy(0,0);
-/// ihm.LCD_printf("Jog=%02d",j);
+/// ihm.LCD_printf("Jog=%02d",jog);
/// ihm.LCD_gotoxy(1,0);
-/// ihm.LCD_printf("Cod=%03d",i);
+/// ihm.LCD_printf("Cod=%03d",codeur);
+/// pc.printf("Jog=%02d Cod=%03d \n",jog,codeur);
/// }
///}
/// @endcode
@@ -58,7 +57,7 @@
class IHM
{
public:
- /// Constructeur pour l'interface Zboard, normalement placé à l'extérieur de main
+ /// Constructeur pour l'IHM de la carte NBoard, placé à l'extérieur du main
/// Les paramètres peuvent être omis (ils ont tous une valeur par défaut)
///
IHM(PinName CANRx=PA_11, PinName CANTx=PA_12);
@@ -78,11 +77,11 @@
UINT8 COD_read(void);
/// positionne le curseur de l'afficheur LCD
///
- /// @param x colonne
- /// @param y ligne
+ /// @param y : ligne (0-1)
+ /// @param x : colonne (0-15)
/// @returns void
///
- void LCD_gotoxy(UINT8,UINT8);
+ void LCD_gotoxy(UINT8 y,UINT8 x);
/// écriture formatée sur l'afficheur LCD
///
@@ -99,7 +98,7 @@
/// lecture du JOG
/// retourne la position (8 possibilités) et l'enfoncement du Jog
/// @param void
- /// @returns void
+ /// @returns valeur JOG
///
UINT8 JOG_read(void);
private:
@@ -112,7 +111,6 @@
CANMessage can_MsgRx[SIZE_FIFO], can_MsgTx;
//extern unsigned char Reception_CAN;
CANMessage trame_Tx;
-//static char tableau_ecran[32]= {32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32};
char tableau_ecran[32];
CAN can;
void can_ISR_Reader(void);
