Example code using rgb_sensor_detection to detect coffee capsule colours.
Dependencies: mbed rgb_sensor_detection
Revision 0:057d26b75cec, committed 2014-07-03
- Comitter:
- bjblazkowicz
- Date:
- Thu Jul 03 09:43:12 2014 +0000
- Commit message:
- Initial commit.
Changed in this revision
diff -r 000000000000 -r 057d26b75cec main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jul 03 09:43:12 2014 +0000 @@ -0,0 +1,40 @@ +/* Discrete RGB color sensor + * + * - uses single-channel light-dependent resistor (via ADC) + * and a RGB LED. + * - compensates background light + * + * Copyright (c) 2014 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <mbed.h> +#include <detection.h> + +Serial console(USBTX, USBRX); + +int main() +{ + RGB_Detection detector(p23,p24,p25,p20); + + console.baud(115200); + + while (1) + { + const char* name = detector.run(); + console.printf("%s\r\n", name); + } + + return 0; +}
diff -r 000000000000 -r 057d26b75cec mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Jul 03 09:43:12 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae \ No newline at end of file
diff -r 000000000000 -r 057d26b75cec rgb_sensor_detection.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rgb_sensor_detection.lib Thu Jul 03 09:43:12 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/bjblazkowicz/code/rgb_sensor_detection/#c865eac393d2