zzzzzzzzzz / Mbed 2 deprecated LAB_10_control

Dependencies:   Motor TCS3472_I2C mbed

Files at this revision

API Documentation at this revision

Comitter:
ThatsAKnife
Date:
Sun Apr 26 19:09:55 2015 +0000
Child:
1:789224bfa1e4
Commit message:
preliminary changes

Changed in this revision

Motor.lib Show annotated file Show diff for this revision Revisions of this file
TCS3472_I2C.lib Show annotated file Show diff for this revision Revisions of this file
control.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Motor.lib	Sun Apr 26 19:09:55 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Motor/#f265e441bcd9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TCS3472_I2C.lib	Sun Apr 26 19:09:55 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/karlmaxwell67/code/TCS3472_I2C/#6d5bb4ad7d6e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/control.cpp	Sun Apr 26 19:09:55 2015 +0000
@@ -0,0 +1,38 @@
+#include "mbed.h"
+#include "Motor.h"
+#include "TCS3472_I2C.h"
+
+PwmOut brightness(p22);
+TCS3472_I2C rgb(p28, p27);
+Timer time;
+int running=1;
+
+int rgb_data[4];
+float set_brightness = 1.0;
+
+int main(){
+    rgb.enablePowerAndRGBC();
+    rgb.setIntegrationTime(100);
+    brightness=set_brightness;
+    time.start();
+    //dc left fwd
+    //dc rght fwd    
+    while(running=1){
+        if(rgb_data[1]>120 && rgb_data[2]<100){ //red;recalibrate
+            while(rgb_data[1]>100){ //recalibrate
+                //dc left rev
+                //dc rght fwd
+                time.reset();
+                //dc left fwd
+                //dc rght fwd
+            };
+        };
+        if(rgb_data[2]>100){ //green;recalibrate
+            while(rgb_data[2]>90){ //recalibrate
+                //dc left fwd
+                //dc rght rev
+                time.reset();
+                //dc left fwd
+                //dc rght fwd
+            };
+        };
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Apr 26 19:09:55 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/433970e64889
\ No newline at end of file