Texas State IEEE / Mbed 2 deprecated grippertest

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers driver.cpp Source File

driver.cpp

00001 #include "mbed.h"
00002 #include "gripper.h"
00003 #include "ColorSensor.h"
00004 
00005 Serial vcom(USBTX, USBRX);
00006 
00007 float frequency = 50.0f;
00008 float duty_cycle = 0.50f;
00009 float period = ( 1.0f / frequency );
00010 
00011 int main()
00012 {
00013     vcom.baud(115200);
00014     
00015     vcom.printf("Hello World!");
00016     
00017     Gripper gripper(PTB0, PTB1);
00018     ColorSensor colorSensor(PTC2, PTC1);
00019     
00020     /*
00021     gripper.grip();
00022     wait(1.0);
00023     gripper.lift();
00024     wait(1.0);
00025     gripper.lower();
00026     wait(1.0);
00027     gripper.release();
00028     wait(1.0);
00029     */
00030     
00031     
00032     
00033     colorSensor.getR();
00034     vcom.printf("%i", colorSensor.getR());
00035     wait(0.5);
00036     
00037 }