this code is for inverted pendulum balancer. it is based on two-loop PID controller. One controller is for Angle and another one is for velocity.

Dependencies:   HCSR04 L298HBridge mbed

communication/communication.h

Committer:
dudu941014
Date:
2017-08-25
Revision:
1:ce626b794a6c
Parent:
0:489498e8dae5

File content as of revision 1:ce626b794a6c:

//////////////////////////////////////////////////////////////////////////////////
// Company: edinburgh of university
// Engineer: ZEjun DU
// 
// Create Date: 2017/08/20 13:06:52
// Design Name: Inverted Pendulum Balancer
// Module Name: commnication with GUI
// Tool Versions: “Keil 5” or “Mbed Complie Online”
// Description: this funcition is to commucation with GUI through Bluetooth HC05
//              the system can invoke this function to send the packet and decode the result
//                           
// 
//////////////////////////////////////////////////////////////////////////////////

/*  Bluetooth(HC-06) example on LPC1768 
*
*    @author: Zejun Du
*-------------------------------------------------------------- 
*    |LPC1768|        |Peripherals|

*---------------------------------------------------------------
*/

#include "mbed.h"

extern int i; 

extern Serial bluetooth;
extern DigitalOut led1;
extern DigitalOut led2;
extern DigitalOut led3;
extern DigitalOut led4;

void Send_Messge(void);
void commander(void);