A classy affair

Dependencies:   mbed mbed-rtos ShiftReg TextLCD

main.cpp

Committer:
mwthewsey
Date:
2019-04-09
Revision:
2:4c18a6d89f19
Parent:
1:241551e24735
Child:
3:3700f0c29710

File content as of revision 2:4c18a6d89f19:

#include "mbed.h"
#include "rtos.h"  //Real Time Operating System. https://os.mbed.com/handbook/RTOS
#include "TextLCD.h"
#include "ShiftReg.h"

//Pinouts for the bluepill can be found here
//https://os.mbed.com/users/hudakz/code/STM32F103C8T6_Hello/

DigitalOut myled(PC_13);    //Onboard LED
Serial PC(PB_10, PB_11);    //TX, RX
TextLCD LCD(PB_12, PB_13, PB_14, PB_15, PA_8, PA_9); // rs, e, d4-d7
//ShiftReg SR1(PA_12, PA_11, PA_10);    //data, store, clock

DigitalOut Muscle0(PA_10);
DigitalOut Muscle1(PA_10);

AnalogIn FEEDBACK_0(PB_0);
AnalogIn FEEDBACK_1(PB_1);


int main()
{   

    
    while(1) {
        myled = 1; // LED is ON
        Muscle0 = 1;
        wait(1); // 200 ms
        
        
        myled = 0; // LED is OFF
        Muscle0 = 0;
        wait(1); // 1 sec
        
        PC.printf("troll lol lol lol lol lol lol\n\r");
        PC.printf("%.6f  %.6f\n\r",FEEDBACK_0.read(),FEEDBACK_1.read());
        LCD.printf("Hello World!\n");
        
    }
}