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.
test.cpp@1:06d6570e52bc, 2020-01-13 (annotated)
- Committer:
- robertbuc
- Date:
- Mon Jan 13 17:15:50 2020 +0000
- Revision:
- 1:06d6570e52bc
- Parent:
- 0:136627249b57
- Child:
- 2:db4c700f1898
main mit nibbleleds
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| robertbuc | 0:136627249b57 | 1 | /* |
| robertbuc | 0:136627249b57 | 2 | weitere viele Beispiele in meinem WIKI |
| robertbuc | 1:06d6570e52bc | 3 | |
| robertbuc | 1:06d6570e52bc | 4 | |
| robertbuc | 1:06d6570e52bc | 5 | */ |
| robertbuc | 1:06d6570e52bc | 6 | #include "mbed.h" |
| robertbuc | 1:06d6570e52bc | 7 | //#define BUTTON1 p14 |
| robertbuc | 1:06d6570e52bc | 8 | //#define BUTTON1 A1 |
| robertbuc | 0:136627249b57 | 9 | |
| robertbuc | 1:06d6570e52bc | 10 | /* |
| robertbuc | 1:06d6570e52bc | 11 | int modifyBit(int x, unsigned char position, bool State); |
| robertbuc | 1:06d6570e52bc | 12 | int lauflicht(bool richtung, int time, int &anz); |
| robertbuc | 1:06d6570e52bc | 13 | |
| robertbuc | 1:06d6570e52bc | 14 | void printb(uint8_t x); |
| robertbuc | 0:136627249b57 | 15 | */ |
| robertbuc | 0:136627249b57 | 16 | |
| robertbuc | 1:06d6570e52bc | 17 | void nibbleLeds(int value); |
| robertbuc | 0:136627249b57 | 18 | |
| robertbuc | 1:06d6570e52bc | 19 | BusOut myleds(LED1,LED2,LED3,LED4); |
| robertbuc | 0:136627249b57 | 20 | DigitalIn button(BUTTON1); |
| robertbuc | 0:136627249b57 | 21 | |
| robertbuc | 0:136627249b57 | 22 | const int INIT=0x03; |
| robertbuc | 0:136627249b57 | 23 | |
| robertbuc | 0:136627249b57 | 24 | int main() |
| robertbuc | 0:136627249b57 | 25 | { |
| robertbuc | 1:06d6570e52bc | 26 | int anzahl,anz; |
| robertbuc | 1:06d6570e52bc | 27 | uint8_t value=INIT; |
| robertbuc | 1:06d6570e52bc | 28 | |
| robertbuc | 1:06d6570e52bc | 29 | nibbleLeds(value); |
| robertbuc | 1:06d6570e52bc | 30 | wait(0.1); |
| robertbuc | 1:06d6570e52bc | 31 | } |
| robertbuc | 1:06d6570e52bc | 32 | |
| robertbuc | 1:06d6570e52bc | 33 | void nibbleLeds(int value) |
| robertbuc | 1:06d6570e52bc | 34 | { |
| robertbuc | 1:06d6570e52bc | 35 | myleds=value%16; |
| robertbuc | 0:136627249b57 | 36 | |
| robertbuc | 0:136627249b57 | 37 | } |