s

Dependencies:   mbed

main.cpp

Committer:
yanay_amir
Date:
2016-05-04
Revision:
0:259c3f9d6fd3

File content as of revision 0:259c3f9d6fd3:

#include "mbed.h"
Serial RN42(p9, p10);
Serial pc(USBTX,USBRX);
DigitalOut RN42_led(LED1);
DigitalOut pc_led(LED2);
DigitalIn joycenter(p14);
InterruptIn obj(p14);
void joy()
{
     wait_ms(25);
     if(joycenter)
     {    
         pc.printf("$$$\r\n"); 
         if(RN42.readable())
         {
             while(RN42.getc() != '\n'){} 
         }
         pc.printf("r,1\r\n"); 
    }
     
}
int main() {

    RN42.baud(115200);
    pc.baud(115200);
    pc.printf("Ready\n");
    obj.rise(&joy);
    joycenter.mode (PullDown);
    while(1)
    {
    
    }
}