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.
main.cpp@0:79d0d21086e0, 2018-02-11 (annotated)
- Committer:
- andrey_als
- Date:
- Sun Feb 11 18:45:43 2018 +0000
- Revision:
- 0:79d0d21086e0
1
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| andrey_als | 0:79d0d21086e0 | 1 | #include "mbed.h" |
| andrey_als | 0:79d0d21086e0 | 2 | #include "TextLCD.h" |
| andrey_als | 0:79d0d21086e0 | 3 | #define AddrDisp 0x4E |
| andrey_als | 0:79d0d21086e0 | 4 | |
| andrey_als | 0:79d0d21086e0 | 5 | //------------------------------------ |
| andrey_als | 0:79d0d21086e0 | 6 | //STM32F030F4P6 |
| andrey_als | 0:79d0d21086e0 | 7 | |
| andrey_als | 0:79d0d21086e0 | 8 | //------------------------------------ |
| andrey_als | 0:79d0d21086e0 | 9 | |
| andrey_als | 0:79d0d21086e0 | 10 | I2C i2c_lcd(D5,D7); //SDA - D5(PB_4), SCL - D7(PA_8), (I2C_SDA,I2C_SCL); |
| andrey_als | 0:79d0d21086e0 | 11 | |
| andrey_als | 0:79d0d21086e0 | 12 | //Инициализация дисплея |
| andrey_als | 0:79d0d21086e0 | 13 | //Изменить в TextLCD_Config.h #define LCM1602 1 |
| andrey_als | 0:79d0d21086e0 | 14 | //TextLCD_I2C lcd(&i2c_lcd, AddrDisp, TextLCD::LCD16x2); |
| andrey_als | 0:79d0d21086e0 | 15 | |
| andrey_als | 0:79d0d21086e0 | 16 | int main() |
| andrey_als | 0:79d0d21086e0 | 17 | { |
| andrey_als | 0:79d0d21086e0 | 18 | i2c_lcd.frequency(400*1000); |
| andrey_als | 0:79d0d21086e0 | 19 | //lcd.setBacklight(TextLCD::LightOn); |
| andrey_als | 0:79d0d21086e0 | 20 | //lcd.setCursor(TextLCD::CurOff_BlkOff); |
| andrey_als | 0:79d0d21086e0 | 21 | //lcd.printf("Hello World!\n"); |
| andrey_als | 0:79d0d21086e0 | 22 | //lcd.printf(" Привет Андрей!\n Hello word!"); //ЁёІікод символа в восьмеричной системе |
| andrey_als | 0:79d0d21086e0 | 23 | while (1) { |
| andrey_als | 0:79d0d21086e0 | 24 | } |
| andrey_als | 0:79d0d21086e0 | 25 | |
| andrey_als | 0:79d0d21086e0 | 26 | } |