misc fixes for esp32 warns

This commit is contained in:
caternuson 2022-07-07 11:38:24 -07:00
parent 028d5c3796
commit 94bf08de33
2 changed files with 26 additions and 22 deletions

View file

@ -90,17 +90,21 @@ void setup() {
analogWrite(BLUE_LED, 0);
}
uint32_t Color(uint8_t r, uint8_t g, uint8_t b) {
return ((uint32_t)r << 16) | ((uint32_t)g << 8) | b;
}
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return (255 - WheelPos * 3, 0, WheelPos * 3);
return Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if(WheelPos < 170) {
WheelPos -= 85;
return (0, WheelPos * 3, 255 - WheelPos * 3);
return Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return (WheelPos * 3, 255 - WheelPos * 3, 0);
return Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
void loop()

View file

@ -400,7 +400,7 @@ void loop() {
Serial.print("Lux = ");
Serial.println(Lux_A);
snprintf (msg, 75, "%ld", Lux_A);
snprintf (msg, 75, "%d", Lux_A);
Serial.println(msg);
client.publish(MQTTlux, msg);