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_square_main.h@2:d9745be6c253, 2022-08-04 (annotated)
- Committer:
- fionalin
- Date:
- Thu Aug 04 15:14:29 2022 -0400
- Revision:
- 2:d9745be6c253
hehe forgot to commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fionalin | 2:d9745be6c253 | 1 | #include <mbed.h> |
fionalin | 2:d9745be6c253 | 2 | |
fionalin | 2:d9745be6c253 | 3 | const PinName MOTOR_ENABLE = D15; |
fionalin | 2:d9745be6c253 | 4 | const PinName MOTOR_STEP = D9; |
fionalin | 2:d9745be6c253 | 5 | const PinName MOTOR_DIR = D13; |
fionalin | 2:d9745be6c253 | 6 | const PinName MOTOR_MS1 = D12; |
fionalin | 2:d9745be6c253 | 7 | const PinName MOTOR_MS2 = D11; |
fionalin | 2:d9745be6c253 | 8 | const PinName MOTOR_MS3 = D10; |
fionalin | 2:d9745be6c253 | 9 | const PinName SLEEP = D1; |
fionalin | 2:d9745be6c253 | 10 | |
fionalin | 2:d9745be6c253 | 11 | |
fionalin | 2:d9745be6c253 | 12 | |
fionalin | 2:d9745be6c253 | 13 | int main() { |
fionalin | 2:d9745be6c253 | 14 | DigitalOut step(MOTOR_STEP); |
fionalin | 2:d9745be6c253 | 15 | |
fionalin | 2:d9745be6c253 | 16 | while (true) { |
fionalin | 2:d9745be6c253 | 17 | step.write(1); |
fionalin | 2:d9745be6c253 | 18 | wait_us(50000); |
fionalin | 2:d9745be6c253 | 19 | step.write(0); |
fionalin | 2:d9745be6c253 | 20 | wait_us(40000); |
fionalin | 2:d9745be6c253 | 21 | } |
fionalin | 2:d9745be6c253 | 22 | } |