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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 3:6ee7c8ce0b7a
- Parent:
- 2:ed06e716cca2
- Child:
- 4:2759062f4264
--- a/main.cpp Wed Dec 27 16:03:31 2017 +0000 +++ b/main.cpp Wed Dec 27 16:12:38 2017 +0000 @@ -24,33 +24,22 @@ DB.output(); Initialise(); - Write_String("Hello"); + DDRAM_Address(0x40); + Write_String("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); } -void clock_in(){ - E = 1; wait(0.001); E = 0; wait(0.001); E = 1; -} +void clock_in(){E = 1; wait(0.001); E = 0; wait(0.001); E = 1;} -void Function_Set(){ - RS = 0; RW = 0; DB = 0x3C; clock_in(); -} +void Function_Set(){RS = 0; RW = 0; DB = 0x3C; clock_in();} -void Display_Off(){ - RS = 0; RW = 0; DB = 0x08; clock_in(); -} +void Display_Off(){RS = 0; RW = 0; DB = 0x08; clock_in();} -void Display_Clear(){ - RS = 0; RW = 0; DB = 0x01; clock_in(); -} +void Display_Clear(){RS = 0; RW = 0; DB = 0x01; clock_in();} -void Entry_Mode_Set(){ - RS = 0; RW = 0; DB = 0x06; clock_in(); -} +void Entry_Mode_Set(){RS = 0; RW = 0; DB = 0x06; clock_in();} -void Display_On(){ - RS = 0; RW = 0; DB = 0x0F; clock_in(); -} +void Display_On(){RS = 0; RW = 0; DB = 0x0F; clock_in();} void Initialise(){ Function_Set(); @@ -67,22 +56,15 @@ wait(0.020); } -void DDRAM_Address(int Address){ - RS = 0; RW = 0; DB = 0x80 + Address; clock_in(); -} +void DDRAM_Address(int Address){RS = 0; RW = 0; DB = 0x80 + Address; clock_in();} void Write_Data(string Letter){ - int ASCII_Converted[32]; - for (int i = 0; i < Letter.length(); i++) { - ASCII_Converted[i] = Letter.at(i); - + ASCII_Converted[i] = Letter.at(i); } - RS = 1; RW = 0; DB = ASCII_Converted[0]; clock_in(); - } void Write_String(string Word){