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: FastPWM HIDScope MODSERIAL mbed
main.cpp
- Committer:
- Mirjam
- Date:
- 2018-09-25
- Revision:
- 1:d6acc3c6261a
- Parent:
- 0:50c494034326
- Child:
- 2:840f7aa50e55
File content as of revision 1:d6acc3c6261a:
#include "mbed.h"
#include "FastPWM.h"
#include "MODSERIAL.h"
#include "HIDScope.h"
AnalogIn  potmeter1(PTC10);
AnalogIn  potmeter2(PTC11);
MODSERIAL  pc(USBTX, USBRX);
//D4 is a digital input for the microcontroller, so should be an digitalOut
//from the K64F. It will tell the motor shiel to let Motor1 turn clockwise
//of count clockwise (CW of CCW). D4 for motor 2
DigitalOut directionM1(D4);
DigitalOut directionM2(D7);
//D5 is a PWM input for the motor controller and determines the PWM signal 
//that the motor controller gives to Motor 1. Higher PWM, higer average voltage.
// D6 for motor 2
FastPWM motor1_pwm(D5);
FastPWM motor2_pwm(D6);
int main(void)
{
    motor1_pwm.period_ms(60); // period is 60 ms
    
    
    while(true){
               
        }
    
}