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:b779bcf836fa, 2022-01-31 (annotated)
- Committer:
- itbusch
- Date:
- Mon Jan 31 06:12:30 2022 +0000
- Revision:
- 0:b779bcf836fa
- Child:
- 1:9607517715ab
100_robot_H_Bridge8835_DIR
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| itbusch | 0:b779bcf836fa | 1 | /* mbed BuschA |
| itbusch | 0:b779bcf836fa | 2 | */ |
| itbusch | 0:b779bcf836fa | 3 | |
| itbusch | 0:b779bcf836fa | 4 | #include "mbed.h" |
| itbusch | 0:b779bcf836fa | 5 | |
| itbusch | 0:b779bcf836fa | 6 | DigitalIn CableSwitch(D2); //PullUp auf Board, PA_10 |
| itbusch | 0:b779bcf836fa | 7 | |
| itbusch | 0:b779bcf836fa | 8 | DigitalOut M1_DIR(D7); |
| itbusch | 0:b779bcf836fa | 9 | DigitalOut M1_PWM(D9); |
| itbusch | 0:b779bcf836fa | 10 | |
| itbusch | 0:b779bcf836fa | 11 | int main() |
| itbusch | 0:b779bcf836fa | 12 | { |
| itbusch | 0:b779bcf836fa | 13 | |
| itbusch | 0:b779bcf836fa | 14 | while (1) |
| itbusch | 0:b779bcf836fa | 15 | { |
| itbusch | 0:b779bcf836fa | 16 | if (CableSwitch == false) |
| itbusch | 0:b779bcf836fa | 17 | { |
| itbusch | 0:b779bcf836fa | 18 | M1_DIR = 1; |
| itbusch | 0:b779bcf836fa | 19 | M1_PWM = 1; |
| itbusch | 0:b779bcf836fa | 20 | } |
| itbusch | 0:b779bcf836fa | 21 | else |
| itbusch | 0:b779bcf836fa | 22 | { |
| itbusch | 0:b779bcf836fa | 23 | M1_DIR = 0; |
| itbusch | 0:b779bcf836fa | 24 | M1_PWM = 1; |
| itbusch | 0:b779bcf836fa | 25 | } |
| itbusch | 0:b779bcf836fa | 26 | } |
| itbusch | 0:b779bcf836fa | 27 | } |