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
main.cpp@0:2698b32ea006, 2015-10-14 (annotated)
- Committer:
- Berni
- Date:
- Wed Oct 14 14:26:13 2015 +0000
- Revision:
- 0:2698b32ea006
1
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Berni | 0:2698b32ea006 | 1 | #include "mbed.h" |
| Berni | 0:2698b32ea006 | 2 | AnalogIn ain(A0); //Dem analogen eingangswert eine Variable zuweisen und den dazugehörigen Pin |
| Berni | 0:2698b32ea006 | 3 | BusOut myled(P1_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1); //Bus definieren mit den LEDs als ausgang |
| Berni | 0:2698b32ea006 | 4 | Serial pc(USBTX, USBRX); // tx, rx |
| Berni | 0:2698b32ea006 | 5 | int main() { |
| Berni | 0:2698b32ea006 | 6 | while(1) |
| Berni | 0:2698b32ea006 | 7 | { |
| Berni | 0:2698b32ea006 | 8 | myled = ain.read_u16()/64; //ausgabe auf die LEDs, der Wert des Potentiometers wird mit 64 dividiert um 10Bit anzuzeigen |
| Berni | 0:2698b32ea006 | 9 | pc.printf("%d\n",myled); |
| Berni | 0:2698b32ea006 | 10 | } |
| Berni | 0:2698b32ea006 | 11 | } |