Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
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 }
Generated on Thu Jul 21 2022 02:31:05 by
1.7.2