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.
Fork of my_example_TCS3200 by
Revision 0:2121a7904d2e, committed 2017-10-09
- Comitter:
- brainliang
- Date:
- Mon Oct 09 10:44:30 2017 +0000
- Child:
- 1:1550b3529045
- Commit message:
- ii
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TCS3200.lib Mon Oct 09 10:44:30 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/wingblank/code/TCS3200/#9edf5a7e29e6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Oct 09 10:44:30 2017 +0000
@@ -0,0 +1,32 @@
+/*-----------------------------------------------------
+ File Name : main.cpp
+ Purpose : For tcs3200 sensor
+ Creation Date : 24-06-2017
+ Last Modified :
+ Created By : Jeasine Ma [jeasinema[at]gmail[dot]com]
+-----------------------------------------------------*/
+#include <cstdio>
+#include <cstring>
+#include <cstdarg>
+
+#include "mbed.h"
+#include "color.h"
+
+// DEBUG USB serial
+Serial ser2usb(USBTX, USBRX);
+int ser_baud = 9600;
+#define LOG(format, ...) do{\ //定义了一个调试的宏,C语言语法
+ ser2usb.printf(format "\r\n", ##__VA_ARGS__);\
+}while(0)
+
+int main() {
+ // S0,S1,S2,S3,OUT
+ ColorSensor color(PA_0, PA_1, PA_4, PB_0, PC_1); //用5个GPIO管脚
+ while(1) {
+ int red = color.getRed();
+ int green = color.getGreen();
+ int blue = color.getBlue();
+ LOG("Color: R:%d G:%d B:%d", red, green, blue);
+ wait(1);
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Oct 09 10:44:30 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/64910690c574 \ No newline at end of file
