Several useful Arduino classes.
Please star this repo and link to it if you find it useful.
Licensed under MIT. See: LICENSE.
A color class to help you with using colors. Useful for RGB leds.
None.
Color selectedColor = Color::green;
Serial.print("R: ");
Serial.print(selectedColor.reds());
Serial.print("G: ");
Serial.print(selectedColor.greens());
Serial.print("B: ");
Serial.print(selectedColor.blues());
Serial.println();
A LED class to help you with using LEDs.
None.
const int DIGITAL_LED_PIN = 13;
const int ANALOG_LED_PIN = A0;
Led digitalLed(DIGITAL_LED_PIN);
Led analogLed(ANALOG_LED_PIN);
int analogLedBrightness = 0;
void setup() {
digitalLed.turnOn();
}
void loop() {
analogLed.setBrightness(analogLedBrightness);
analogLedBrightness++;
if (analogLedBrightness >= 255) {
analogLedBrightness = 0;
digitalLed.toggleOnOrOff();
}
digitalLed.update();
analogLed.update();
}
...
...
...
...