File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
stm32f4_discovery/colour_tcs3414 Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ class Sensorthread : public modm::pt::Protothread
5151 // Setup WaitTime to further slow down samplerate
5252 PT_CALL (sensor.setWaitTime (modm::tcs3472::WaitTime::MSEC_2_4));
5353
54+ // Dummy read required
55+ PT_CALL (sensor.readColor ());
5456 // Fetch one sample ...
5557 PT_CALL (sensor.readColor ());
5658 // ...and set the high threshold 20% above current clear
@@ -59,13 +61,14 @@ class Sensorthread : public modm::pt::Protothread
5961 while (true )
6062 {
6163 PT_CALL (sensor.reloadInterrupt ());
64+ PT_WAIT_UNTIL (TCS3472_INT::read () == false );
6265 if (PT_CALL (sensor.readColor ()))
6366 {
6467 const auto color = data.getColor ();
6568 MODM_LOG_INFO << " RGB: " << color;
6669 modm::color::HsvT<uint16_t > hsv;
6770 color.toHsv (&hsv);
68- MODM_LOG_INFO << " HSV : " << hsv << modm::endl;
71+ MODM_LOG_INFO << " \t HSV : " << hsv << modm::endl;
6972 }
7073 }
7174
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ class ThreadOne : public modm::pt::Protothread
7070 MODM_LOG_INFO << " RGB: " << color;
7171 modm::color::HsvT<uint16_t > hsv;
7272 color.toHsv (&hsv);
73- MODM_LOG_INFO << " HSV : " << hsv << modm::endl;
73+ MODM_LOG_INFO << " \t HSV : " << hsv << modm::endl;
7474 }
7575 timeout.restart (500ms);
7676 PT_WAIT_UNTIL (timeout.isExpired ());
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ class ThreadOne : public modm::pt::Protothread
102102 stream << " RGB: " << color;
103103 modm::color::HsvT<uint16_t > hsv;
104104 color.toHsv (&hsv);
105- stream << " " << hsv << modm::endl;
105+ stream << " \t HSV: " << hsv << modm::endl;
106106 }
107107 timeout.restart (500ms);
108108 PT_WAIT_UNTIL (timeout.isExpired ());
You can’t perform that action at this time.
0 commit comments