takeshi yoshida / Mbed 2 deprecated 2016_lambdaController

Dependencies:   mbed

Dependents:  

example.cpp

Committer:
gakuburu
Date:
2016-10-27
Revision:
8:3c53e18e16e6

File content as of revision 8:3c53e18e16e6:

#include "mbed.h"
#include "LambdaController.h"

int main(void)
{
    Serial pc(USBTX, USBRX);
    pc.baud(9600);
    
    LambdaController con(D1, D0);
    
    con.initialize_axis();
    
    while(1)
    {
        if (con.get_error())
        {
            pc.printf("error : %d\r\n", con.get_error());
        }
        else
        {
            pc.printf("buttons : %x\r\n", con.get_all_switch());
            pc.printf("1 : %d\r\n", con.get_switch(0));
//            pc.printf("joystick0 : %f\r\n", con.get_axis(con.Stick0X));
//            pc.printf("joystick1 : %f\r\n", con.get_axis(con.Stick0Y));
//            pc.printf("joystick2 : %f\r\n", con.get_axis(con.Stick1X));
//            pc.printf("joystick3 : %f\r\n", con.get_axis(con.Stick1Y));
        }
    }
}