Arm Mbed and Pelion Device Management support forum

Motor Control Bit-banged PWM

I’m using an mbed to bit-bang a PWM signal to a H bridge. I’ve got 2 outputs called TRT_MTR and INV_TRT_MTR (which is TRT_MTR inverted) which are configured as digital outputs. I’ve used a header file to contain my pin allocations, and then using a cpp file to manipulate them. I’m getting compile error that TRT_MTR is declared in the Traction cpp file, and the main cpp file (error code L6200E). As I’m using a header file TRT_MTR is not declared in either the Traction cpp file or the main cpp file.

I haven’t downloaded the code to my Mbed LPC1768 as it won’t compile yet.

I’m unsure of where my error is.

Thanks

Rob

I’ve managed to solve this by amalgamating my subs into one cpp file, rather than seperating them in seperate cpp files and using a header file to link them together.

Hopefully this might help someone in the future.