PwmOut is showing as an Unknown type name for the FF-LPC546XX.
the error shows as Unknown type name ‘PwmOut’
the code:
#include “mbed.h”
#include
Serial pc(USBTX, USBRX);
InterruptIn i1 (p5);
DigitalIn i2 (p6);
DigitalIn im (p9);
PwmOut EN (p21);
DigitalOut L1 (LED1);
DigitalOut L2 (LED2);
//DigitalOut EN (p20);
DigitalOut a1 (p7);
DigitalOut a2 (p8);
Timer timer;
int f;
int b;
int m;
int T;
int Direct;
float RPM;
float t1 = 1;
int mr = {1,0,1};
int ml = {1,1,0};
int ms = {1,0,0};
int mfs = {0,0,0};
void time(){
switch(T){
case 0:
timer.start();
T = 1;
break;
case 1:
t1 = timer.read();
timer. reset();
break;
}
if(i2 == 0){
Direct = 1;
}else{
Direct = 0;
}
};
// main() runs in its own thread in the OS
int main()
{
while (true) {
EN.period_ms(20);
EN = 1;
m = im;
f = i1;
b = i2;
L1 = i1;
L2 = i2;
switch (m) {
case 0:
EN = 1;
a1 = 1;
a2 = 0;
break;
case 1:
EN = 1;
a1 = 0;
a2 = 1;
break;
}
i1.rise(time);
//RPM = (1/(t1*11))*60;
//pc.printf("%i %i %i %f\n", f, b, Direct, t1);
}
}