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
- Committer:
- 302Instructor
- Date:
- 2015-01-22
- Revision:
- 0:0cb6f477149a
File content as of revision 0:0cb6f477149a:
#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;
}
}
}