TJPS

Dependencies:   mbed

Fork of Laser_Rangefinder by jim hamblen

main.cpp

Committer:
Fairy_Paolina
Date:
2014-02-24
Revision:
1:d576753ebd76
Parent:
0:ccc26a94788d

File content as of revision 1:d576753ebd76:

#include "mbed.h"
#include "string.h"
#include "LRF.h"

Serial pc(USBTX, USBRX);
extern DigitalOut myled;
extern Serial lrf;

#define TRIANGLE 3
#define RECTANGLE 2
#define CIRCLE 1

int main() {
    int shape;
    
    LRFinit();
    shape=GetShape();
    pc.printf("Shape:\n");
    
    if(shape == TRIANGLE) pc.printf("Triangle\n");
    else if(shape == RECTANGLE) pc.printf("Rectangle\n");
    else pc.printf("Circle\n");
    


    }