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@7:dbe5b06987d7, 2019-05-01 (annotated)
- Committer:
- mksaga
- Date:
- Wed May 01 02:08:39 2019 +0000
- Revision:
- 7:dbe5b06987d7
- Parent:
- 6:8562953f94bf
- Child:
- 8:e0cd3bd2d051
finally gets motor working using SN754410 h-bridge
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fatiho | 0:572230252a64 | 1 | #include "mbed.h" |
mksaga | 3:7e158df628f1 | 2 | |
mksaga | 7:dbe5b06987d7 | 3 | DigitalOut motor_pin_1(p14); |
mksaga | 7:dbe5b06987d7 | 4 | DigitalOut motor_pin_2(p15); |
mksaga | 7:dbe5b06987d7 | 5 | DigitalOut motor_enable(p19); |
mksaga | 2:66ab94f69a1a | 6 | |
mksaga | 7:dbe5b06987d7 | 7 | void run_pump(int secs) |
mksaga | 7:dbe5b06987d7 | 8 | { |
mksaga | 7:dbe5b06987d7 | 9 | motor_enable = 1; |
mksaga | 7:dbe5b06987d7 | 10 | motor_pin_1 = 0; |
mksaga | 7:dbe5b06987d7 | 11 | motor_pin_2 = 1; |
mksaga | 7:dbe5b06987d7 | 12 | |
mksaga | 7:dbe5b06987d7 | 13 | int i = 0; |
mksaga | 7:dbe5b06987d7 | 14 | while(i < secs * 148) { i++; printf("%d | ", i);} |
mksaga | 7:dbe5b06987d7 | 15 | motor_pin_2 = 0; |
mksaga | 6:8562953f94bf | 16 | } |
mksaga | 6:8562953f94bf | 17 | |
mksaga | 5:3b378e0659e9 | 18 | int main() { |
mksaga | 7:dbe5b06987d7 | 19 | run_pump(10); |
mksaga | 7:dbe5b06987d7 | 20 | printf("\ngreetings\n"); |
mksaga | 5:3b378e0659e9 | 21 | } |