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.
Revision 0:0cb6f477149a, committed 2015-01-22
- Comitter:
- 302Instructor
- Date:
- Thu Jan 22 20:05:48 2015 +0000
- Commit message:
- 1/22/15
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Jan 22 20:05:48 2015 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+
+void countDirection(int);
+DigitalOut steering_pwm(PTE20);
+int count = 0;
+int ref = 120e3;
+int countDir = 0;
+
+/*void countDirection(int)
+{
+ if (countDir = 0) {
+ count++;
+ } else (countDir = 1) {
+ count--;
+ }
+}*/
+
+int main()
+{
+ while(1) {
+ if (count == 1) {
+ countDir = 0;
+ } else if(count == 240e3){
+ countDir = 1;
+ }
+
+ if (countDir == 0) {
+ count+=1;
+ } else if (countDir == 1) {
+ count+=-1;
+ }
+
+ if (count <= ref) {
+ steering_pwm = 1;
+ } else {
+ steering_pwm = 0;
+ }
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Jan 22 20:05:48 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/0b3ab51c8877 \ No newline at end of file