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: mbed
main.cpp
- Committer:
- marvin3241
- Date:
- 2015-05-28
- Revision:
- 0:8d2632322439
- Child:
- 1:1c15cf46e1f8
File content as of revision 0:8d2632322439:
#include "mbed.h"
DigitalIn K1 (dp25); //Keuzeschakelaar stand 1: Sumo.
DigitalIn K2 (dp16); //Keuzeschakelaar stand 2: Straight line.
DigitalIn K3 (dp26); //Keuzeschakelaar stand 3: Service.
AnalogIn SA (dp9); //Sensor links voor.
AnalogIn SRV (dp10); //Sensor rechts voor.
AnalogIn SLV (dp11); //Sensor links achter.
//AnalogIn SRA (dp13); //Sensor rechts achter.
DigitalOut MLL (dp4); //Draairichting linker motor linksom.
DigitalOut MLR (dp6); //Draairichting linker motor rechtsom.
DigitalOut MRL (dp1); //Draairichting rechter motor linksom.
DigitalOut MRR (dp24); //Draairichting rechter motor rechtsom.
DigitalOut LED (dp28); //Indicatie LED.
PwmOut ML (dp18); //PWM-signaal voor de linker motor.
PwmOut MR (dp2); //PWM-signaal voor de rechter motor.
Serial pc(USBTX, USBRX); //Gebruik consol.
int main()
{
while (1)
{
if (SLV <= 0.2)
{
LED = !LED;
wait(1);
}
}
}