Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
TomSaw committed Jan 12, 2022
1 parent f4134c3 commit 7d115fe
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/arduino_nano/color/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Sensorthread : public modm::pt::Protothread
if (PT_CALL(sensor.readColor()))
{
const auto rgb = data.getColor();
MODM_LOG_INFO << "RGB: " << rgb << "\tHSV: " << modm::color::Hsv(rgb) << modm::endl;
MODM_LOG_INFO << "RGB: " << rgb << "\tHSV: " << modm::color::Hsv888(rgb) << modm::endl;
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/nucleo_f446re/color/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ThreadOne : public modm::pt::Protothread
if (PT_CALL(sensor.readColor()))
{
const auto rgb = data.getColor();
MODM_LOG_INFO << "RGB: " << rgb << "\tHSV: " << modm::color::Hsv(rgb) << modm::endl;
MODM_LOG_INFO << "RGB: " << rgb << "\tHSV: " << modm::color::Hsv888(rgb) << modm::endl;
}
timeout.restart(500ms);
PT_WAIT_UNTIL(timeout.isExpired());
Expand Down
6 changes: 3 additions & 3 deletions examples/stm32f469_discovery/game_of_life/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ uint16_t * displayBuffer;
#define TRAIL_LENGTH ((1 << TRAIL_POWER) + 1)
constexpr uint8_t alive = (1 << TRAIL_POWER);

#define COLOR_SHADE(red, green, blue, fraction) modm::color::Rgb(\
#define COLOR_SHADE(red, green, blue, fraction) modm::color::Rgb888(\
uint8_t(uint32_t(red) * (fraction) / TRAIL_LENGTH), \
uint8_t(uint32_t(green) * (fraction) / TRAIL_LENGTH), \
uint8_t(uint32_t(blue) * (fraction) / TRAIL_LENGTH) )
Expand Down Expand Up @@ -137,7 +137,7 @@ static inline void touch(framebuffer_t buffer)

static inline void setPixel(int x, int y, uint8_t color)
{
#define DRAW(x, y) displayBuffer[(y) * 800 + (x)] = GET_TRAIL_COLOR(color).color;
#define DRAW(x, y) displayBuffer[(y) * 800 + (x)] = GET_TRAIL_COLOR(color).getValue();
#if SCALE >= 8
// >:v x:y
// 0 | |
Expand All @@ -148,7 +148,7 @@ static inline void setPixel(int x, int y, uint8_t color)
// 5 | x x |
// 6 | xxxx |
// 7 | |
GET_TRAIL_COLOR(color).color;
GET_TRAIL_COLOR(color).getValue();
// 1
DRAW(x+2, y+1);
DRAW(x+3, y+1);
Expand Down
2 changes: 1 addition & 1 deletion examples/stm32f4_discovery/colour_tcs3414/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ThreadOne : public modm::pt::Protothread
{
if (PT_CALL(sensor.readColor())) {
const auto rgb = data.getColor();
stream << "RGB: " << rgb << "\tHSV: " << modm::color::Hsv(rgb) << modm::endl;
stream << "RGB: " << rgb << "\tHSV: " << modm::color::Hsv888(rgb) << modm::endl;
}
timeout.restart(500ms);
PT_WAIT_UNTIL(timeout.isExpired());
Expand Down
2 changes: 1 addition & 1 deletion src/modm/driver/color/tcs3472.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ struct tcs3472
addr(uint8_t version=5)
{ return version < 5 ? 0x39 : 0x29; }

using Rgb = color::RgbT<uint16_t>;
using Rgb = color::Rgb161616;

struct modm_packed
Data
Expand Down

0 comments on commit 7d115fe

Please sign in to comment.