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: MFS_Display_HAL LCD_i2c_GSOE HSAnalogIn_GSOE
vorlageByte.cpp@0:645e47a5b9db, 2022-07-23 (annotated)
- Committer:
- lumppi
- Date:
- Sat Jul 23 12:46:36 2022 +0000
- Revision:
- 0:645e47a5b9db
vorlage_2021_update MBED
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| lumppi | 0:645e47a5b9db | 1 | //bibliotheken+programme von jörg veröffentlicht unter |
| lumppi | 0:645e47a5b9db | 2 | //https://os.mbed.com/users/jack1930/code/?page=1 |
| lumppi | 0:645e47a5b9db | 3 | |
| lumppi | 0:645e47a5b9db | 4 | //mit if 1=aktivieren, if 0=deaktivieren |
| lumppi | 0:645e47a5b9db | 5 | #if 1 |
| lumppi | 0:645e47a5b9db | 6 | |
| lumppi | 0:645e47a5b9db | 7 | #include "mbed.h" |
| lumppi | 0:645e47a5b9db | 8 | #include "LCD.h" |
| lumppi | 0:645e47a5b9db | 9 | |
| lumppi | 0:645e47a5b9db | 10 | lcd mylcd; |
| lumppi | 0:645e47a5b9db | 11 | PortOut leds(PortC,0xFF); |
| lumppi | 0:645e47a5b9db | 12 | PortIn dips(PortB,0xFF); |
| lumppi | 0:645e47a5b9db | 13 | int wert; |
| lumppi | 0:645e47a5b9db | 14 | |
| lumppi | 0:645e47a5b9db | 15 | void init() |
| lumppi | 0:645e47a5b9db | 16 | { |
| lumppi | 0:645e47a5b9db | 17 | mylcd.clear(); |
| lumppi | 0:645e47a5b9db | 18 | mylcd.cursorpos(0); |
| lumppi | 0:645e47a5b9db | 19 | mylcd.printf("Vorlage BYTE"); |
| lumppi | 0:645e47a5b9db | 20 | dips.mode(PullDown); |
| lumppi | 0:645e47a5b9db | 21 | } |
| lumppi | 0:645e47a5b9db | 22 | |
| lumppi | 0:645e47a5b9db | 23 | int main() |
| lumppi | 0:645e47a5b9db | 24 | { |
| lumppi | 0:645e47a5b9db | 25 | init(); |
| lumppi | 0:645e47a5b9db | 26 | while(1) |
| lumppi | 0:645e47a5b9db | 27 | { |
| lumppi | 0:645e47a5b9db | 28 | wert = dips; |
| lumppi | 0:645e47a5b9db | 29 | leds = wert; |
| lumppi | 0:645e47a5b9db | 30 | mylcd.cursorpos(0x40); |
| lumppi | 0:645e47a5b9db | 31 | mylcd.printf("dips = %3d",wert); |
| lumppi | 0:645e47a5b9db | 32 | } |
| lumppi | 0:645e47a5b9db | 33 | } |
| lumppi | 0:645e47a5b9db | 34 | #endif |