SDVX controller project

Dependencies:   USBDevice mbed

main.cpp

Committer:
lukeoftheaura
Date:
2018-01-13
Revision:
4:6192f1728e75
Parent:
3:b88fff5420e2

File content as of revision 4:6192f1728e75:

#include "mbed.h"
#include "USBKeyboard.h"
#include "USBMouse.h"
#define ever ;;

Serial PC(USBTX,USBRX);
USBKeyboard key;
DigitalOut LED(LED1);
DigitalIn button1(PTB8);
bool bt1state = false;

int main() {
    bool Pressed = false;

    for(ever)
    {
        LED = Pressed;

        if (Pressed)
        {
           if (button1)
           {
                if (key.keyPress(']'))
                {
                    Pressed = false;
                }
            }
        }
        else
        {
            if (!button1)
            { 
                if (key.keyPress('d'))
                {
                   Pressed = true;
                }
            }        
        }
    }
}