Good morning Vietnam!! I'm new of mbed world my first MCU programming was been PIC16F84A. I've a problem with this software:
test di intefacciamento con LCD HD44780 senza libreria
- include "mbed.h"
BusOut LCD_Data(p21, p22, p23, p24, p25, p26, p27, p28);
DigitalOut E(p20);
DigitalOut RS(p17);
DigitalOut RW(p19);
DigitalOut A(p29);
DigitalOut K(p30);
DigitalOut OK(LED1);
AnalogOut contrast(p18);
int main ()
{
char text1[4] = {'C','I','A','O'};
char text2[9] = {'V','I','T','T','O','R','I','O','!'};
char init[5] = {1, 60, 12, 6, 2};
inizializzazione LCD
contrast = 2.5;
A = 1;
K = 0;
RW = 0;scrittura
RS = 0;comando
for(int k = 0; k <= 4; k++)
{
LCD_Data = init[k];
E = 1;
wait(0.5);
E = 0;
}
scrittura
LCD_Data = 5;indirizzo prima riga
E = 1;
wait(0.5);
E = 0;
RS = 1;dato
for(int i = 0; i <= 3; i++)
{
LCD_Data = text1[i];
E = 1;
wait(0.5);
E = 0;
}
RS = 0;
LCD_Data = 67;
E = 1;
wait(0.5);
E = 0;
RS = 1;
for(int j = 0; j <= 8; j++)
{
LCD_Data = text2[j];
E = 1;
wait(0.5);
E = 0;
}
OK = 1;
}
I want interface a HD44780 is my software right?
P.S.: i'm sorry for my bad english
Good morning Vietnam!! I'm new of mbed world my first MCU programming was been PIC16F84A. I've a problem with this software:
test di intefacciamento con LCD HD44780 senza libreria
BusOut LCD_Data(p21, p22, p23, p24, p25, p26, p27, p28); DigitalOut E(p20); DigitalOut RS(p17); DigitalOut RW(p19); DigitalOut A(p29); DigitalOut K(p30); DigitalOut OK(LED1); AnalogOut contrast(p18);
int main () { char text1[4] = {'C','I','A','O'}; char text2[9] = {'V','I','T','T','O','R','I','O','!'}; char init[5] = {1, 60, 12, 6, 2};
inizializzazione LCD contrast = 2.5; A = 1; K = 0; RW = 0;scrittura RS = 0;comando for(int k = 0; k <= 4; k++) { LCD_Data = init[k]; E = 1; wait(0.5); E = 0; }
scrittura LCD_Data = 5;indirizzo prima riga E = 1; wait(0.5); E = 0; RS = 1;dato for(int i = 0; i <= 3; i++) { LCD_Data = text1[i]; E = 1; wait(0.5); E = 0; } RS = 0; LCD_Data = 67; E = 1; wait(0.5); E = 0; RS = 1; for(int j = 0; j <= 8; j++) { LCD_Data = text2[j]; E = 1; wait(0.5); E = 0; } OK = 1; }
I want interface a HD44780 is my software right?
P.S.: i'm sorry for my bad english