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: Encoder MODSERIAL mbed
Fork of frdm_Motortryout2_test by
main.cpp
- Committer:
- Margreeth95
- Date:
- 2015-09-28
- Revision:
- 4:f11dacf12ca7
- Parent:
- 3:051c91b04acd
- Child:
- 5:8affd11a5674
File content as of revision 4:f11dacf12ca7:
#include "mbed.h"
#include "encoder.h"
#include "MODSERIAL.h"
Serial pc(USBTX, USBRX); // tx, rx
DigitalOut led(LED_RED);
DigitalOut motor2direction(D4); //D4 en D5 zijn motor 2 (op het motorshield)
PwmOut motor2speed(D5);
DigitalIn button1(SW3);
int main()
{
//test
motor2direction = 0;
motor2speed = 0;
led = 1;
pc.baud(9600);
while(true)
{
if(button1 == 0)
{
motor2direction = 1;
motor2speed = 0.5f;
pc.printf("het werkt");
wait(1);
led = 0;
wait(0.2f);
motor2speed = 0;
led = 1;
}
}
}
