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 5:d4f2c480044c, committed 2015-09-03
- Comitter:
- amackp
- Date:
- Thu Sep 03 01:06:00 2015 +0000
- Parent:
- 4:3e3b4ce8905f
- Commit message:
- moves 1 direction
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Sep 02 19:47:45 2015 +0000
+++ b/main.cpp Thu Sep 03 01:06:00 2015 +0000
@@ -59,7 +59,7 @@
PwmOut pin3(P0_10); // enable h bridge
PwmOut pin1(P0_9); // h bridge 1 Switch these two to change direction
-DigitalOut pin2(P0_11); // h bridge 2
+PwmOut pin2(P0_11); // h bridge 2
@@ -81,8 +81,6 @@
}
//Connor's methods Start
-
-
void motor_stop(){
pin3 = 1;
pin1 = 0;
@@ -92,15 +90,15 @@
}
void drive_backward(){
-pin3 = 1;
+pin3 = 255;
pin1 = 0;
-pin2 = 1;
+pin2 = 255;
}
void drive_forward(){
pin3 = 1;
-pin1 = 0;
-pin2 = 1;
+pin1 = 255;
+pin2 = 0;
}
void pulse_forward(){
@@ -124,7 +122,7 @@
drive_backward();
wait(.900);
motor_stop();
-
+
if (myled == 1) //so you can see if dispense is being called, toggles led on and off
{
myled = 0;