Created
August 22, 2020 03:04
-
-
Save Pharap/abff335bf18ab5092934c5f8ed37ed4b to your computer and use it in GitHub Desktop.
Demonstrating different combinations of text parameters on Arduboy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduboy2.h> | |
Arduboy2 arduboy; | |
// This code is under the CC0 licence | |
// and hence is in the public domain, | |
// or your local equivalent. | |
void setup() | |
{ | |
arduboy.begin(); | |
} | |
void loop() | |
{ | |
if(!arduboy.nextFrame()) | |
return; | |
arduboy.pollButtons(); | |
arduboy.clear(); | |
arduboy.fillRect(0, 0, 16, HEIGHT, WHITE); | |
// These are the legal permutations | |
{ | |
arduboy.setTextColor(WHITE); | |
arduboy.setTextBackground(BLACK); | |
arduboy.println(F("Hello")); | |
arduboy.setTextColor(BLACK); | |
arduboy.setTextBackground(WHITE); | |
arduboy.println(F("Hello")); | |
arduboy.setTextColor(BLACK); | |
arduboy.setTextBackground(BLACK); | |
arduboy.println(F("Hello")); | |
arduboy.setTextColor(WHITE); | |
arduboy.setTextBackground(WHITE); | |
arduboy.println(F("Hello")); | |
} | |
// These are the permutations that the API considers 'illegal' | |
{ | |
arduboy.setTextColor(WHITE); | |
arduboy.setTextBackground(4); | |
arduboy.println(F("Hello")); | |
arduboy.setTextColor(2); | |
arduboy.setTextBackground(4); | |
arduboy.println(F("Hello")); | |
arduboy.setTextColor(2); | |
arduboy.setTextBackground(WHITE); | |
arduboy.println(F("Hello")); | |
arduboy.setTextColor(2); | |
arduboy.setTextBackground(2); | |
arduboy.println(F("Hello")); | |
} | |
arduboy.display(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment