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: BLE_API mbed nRF51822
Revision 4:3e3b4ce8905f, committed 2015-09-02
- Comitter:
- amackp
- Date:
- Wed Sep 02 19:47:45 2015 +0000
- Parent:
- 3:cf8bb9a7756d
- Child:
- 5:d4f2c480044c
- Commit message:
- still only goes 1 direction, but works
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Sep 01 14:01:33 2015 +0000
+++ b/main.cpp Wed Sep 02 19:47:45 2015 +0000
@@ -56,9 +56,9 @@
// Connor's Code start -------------------------------------------------
DigitalOut myled(P0_19); //onboard LED
-DigitalOut pin3(P0_10); // enable h bridge
+PwmOut pin3(P0_10); // enable h bridge
-DigitalOut pin1(P0_9); // h bridge 1 Switch these two to change direction
+PwmOut pin1(P0_9); // h bridge 1 Switch these two to change direction
DigitalOut pin2(P0_11); // h bridge 2
@@ -93,8 +93,8 @@
void drive_backward(){
pin3 = 1;
-pin1 = 1;
-pin2 = 0;
+pin1 = 0;
+pin2 = 1;
}
void drive_forward(){
@@ -209,11 +209,11 @@
ble.startAdvertising();
pc.printf("Advertising Start \r\n");
- while(1)
- {
- dispense();
+ //while(1)
+ //{
+ //dispense();
//ble.waitForEvent();
- }
+ //}
}