BIGTHING

Dependencies:   KS0108 mbed

main.cpp

Committer:
rohangala
Date:
2016-03-15
Revision:
1:630aef63181c
Parent:
0:98be6bf27557
Child:
2:015a5a76bb82

File content as of revision 1:630aef63181c:

#include "mbed.h"
#include "stdio.h"        
DigitalOut myled(LED1);
Serial pc(USBTX, USBRX);
Serial micro(PTA2, PTA1); // tx, rx
char buff[]={'\0'};

uint8_t val;
 
int main() 
{myled = 1;
      //  wait(3);
        

     while(1) 
     {
      if(micro.readable()) 
      {
    
        myled = 0;
        val=(micro.getc());
        

        if(val == 0x00)
        {      
            
            
            
            pc.putc(0x04);
            
        }

        if(val == 0x01)
        {      
           
            pc.putc(0x09);
        }
  
        val=0x00;
        
        wait(2);
         myled=1;
       }
    }       
 }