Programs added

This commit is contained in:
hodginsa
2018-06-21 08:17:27 -04:00
parent 01d90ef571
commit 218800df16
5 changed files with 363 additions and 44 deletions

View File

@@ -11,29 +11,90 @@
#include <Adafruit_GFX.h>
#include <Adafruit_DotStarMatrix.h>
#include <Adafruit_DotStar.h>
#include <Fonts/TomThumb.h>
#include <Fonts/FreeMonoOblique9pt7b.h>
#include "image.h"
#define DATAPIN 19
#define CLOCKPIN 18
char *names[] = {"Unexpected Maker",
"Jon Peer (Rhymes with Beer)",
"Ran-Dee Glenn",
"Stee-ven Lud-gate a.k.a. chunky steve-oh",
"Christian Will-helm",
"Dale Cousins",
"Roland Alvares",
"Abdul Aziz is my best friend",
"Richard Stewart",
"Stee-fen Goo-juh",
"Alexandru Stan",
"Brad Pow-urrs. I mean, pretty straightforward.",
"Code Fox",
"Bobby CC Wong",
"Tim Bye-Num",
"nic gill",
"Jonathan BET-zold",
"Stay-fan",
"Nicolai Schwarz ",
"Bligh-th Gar-rat",
"Mark S",
"York",
"Ernesto Cibrian",
"Dave Platts",
"Dj Walker-Morgan",
"João Miranda",
"Ther mound (shouldn't be too tough :) )",
"Reverend Alexander J Bor sick",
"APSoft (Hey Pea Soft)",
"Patrick Hah-ga-mahn",
"Can you say: “YouTube.com/Dubwise” pronounced “Dub-wise”.",
"Fabian Christ",
"Steve Berry-man",
"I feel like it's a pretty self explanatory name haha!",
"Noah Westwind",
"MUR-ID-EE-N WIT",
"Troy Holten",
"Grant Patterson",
"Ta-tee Wall-er",
"Ryan Burrow",
"ay-vert klei-ink",
"leee-no veee-hen",
"Andrew Kind rhymes with mind",
"Edward Wowl-man",
"Simon Cleveland",
"Andrea Scolari",
"Daril Mac larin",
"Patrick Füglistaller",
"Alexandre Tron ( Like the movie , but in french :D GL ! )",
"Lucky 13",
"Dan-yul Hoff-my-stir}"
};
int mario[256][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {248, 171, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {248, 171, 0}, {112, 104, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {248, 171, 0}, {248, 171, 0}, {112, 104, 0}, {216, 0, 0}, {248, 171, 0}, {216, 0, 0}, {216, 0, 0}, {248, 171, 0}, {216, 0, 0}, {112, 104, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {248, 171, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {248, 171, 0}, {248, 171, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {248, 171, 0}, {248, 171, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {216, 0, 0}, {216, 0, 0}, {216, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {112, 104, 0}, {0, 0, 0}, {0, 0, 0}};
int patreon[256][3] = {{5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {249, 0, 0}, {249, 0, 0}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {255, 255, 255}, {255, 255, 255}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {249, 0 , 0}, {249, 0 , 0}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {249, 0 , 0}, {249, 0 , 0}, {5, 10, 150}, {5, 10, 150}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {249, 0 , 0}, {249, 0 , 0}, {5, 10, 150}, {5, 10, 150}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {249, 0 , 0}, {249, 0 , 0}, {5, 10, 150}, {94, 120, 138}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {249, 0 , 0}, {249, 0 , 0}, {5, 10, 150}, {5, 10, 150}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {249, 0 , 0}, {249, 0 , 0}, {5, 10, 150}, {5, 10, 150}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {249, 0 , 0}, {249, 0 , 0}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {249, 0 , 0}, {249, 0 , 0}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {249, 0 , 0}, {249, 0 , 0}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {249, 0 , 0}, {249, 0 , 0}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {249, 0 , 0}, {249, 0 , 0}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}, {5, 10, 150}};
#define BRIGHTNESS 30
#define BRIGHTNESS 150
// MATRIX DECLARATION:
Adafruit_DotStarMatrix pixo = Adafruit_DotStarMatrix(
16, 16, DATAPIN, CLOCKPIN,
DS_MATRIX_BOTTOM + DS_MATRIX_LEFT +
DS_MATRIX_ROWS + DS_MATRIX_PROGRESSIVE,
DOTSTAR_BGR);
16, 16, DATAPIN, CLOCKPIN,
DS_MATRIX_TOP + DS_MATRIX_LEFT +
DS_MATRIX_ROWS + DS_MATRIX_PROGRESSIVE,
DOTSTAR_BGR);
const uint16_t primaryColors[] = {
pixo.Color(100, 0, 0), pixo.Color(0, 100, 0), pixo.Color(0, 0, 100)
const uint16_t colors[] = {
pixo.Color(100, 100, 100), pixo.Color(0, 100, 0), pixo.Color(0, 0, 100)
};
int x = pixo.width();
int pass = 0;
int y = 0;
int numChars = 0;
void setup() {
Serial.begin(115200);
@@ -41,29 +102,50 @@ void setup() {
//while (!Serial) delay(500);
pixo.begin();
pixo.setTextWrap(false);
pixo.setBrightness(BRIGHTNESS);
for (byte i = 0; i < 3; i++) {
pixo.fillScreen(primaryColors[i]);
pixo.show();
delay(500);
pixo.fillScreen(0);
pixo.show();
}
pixo.setFont(&FreeMonoOblique9pt7b);
pixo.setTextColor(colors[pass]);
Serial.println(names[y]);
numChars = numChar(names[y]);
Serial.println(numChars);
//while(!Serial);
}
int x = pixo.width();
int pass = 0;
void loop() {
pixo.setBrightness(BRIGHTNESS);
//while(1){
//SinglePix();
// RandomPix();
//}
notification();
if (Serial.available() > 0) {
Serial.read();
Serial.flush();
y++;
Serial.println(names[y]);
numChars = numChar(names[y]);
Serial.println(numChars);
x = 15;
}
pixo.fillScreen(0);
pixo.setCursor(x, 10);
pixo.print(F(names[y]));
if (--x < numChars * -11) {
x = pixo.width();
if (++pass >= 30) pass = 0;
//pixo.setTextColor(colors[pass]);
}
pixo.show();
delay(15);
}
void SinglePix() {
for (int x = 0; x < 256; x++) {
pixo.setPixelColor(x, 255, 255, 255);
@@ -86,7 +168,7 @@ void notification() {
for (int j = 15; j >= 0; j--) {
pixo.fillScreen(0);
for (int i = 0; i < 256; i++) {
pixo.setPixelColor(i + (j * 16), mario[i][0], mario[i][1], mario[i][2]);
pixo.setPixelColor(i + (j * 16), patreon[i][0], patreon[i][1], patreon[i][2]);
//Serial.println(i);
//delay(1);
}
@@ -97,7 +179,7 @@ void notification() {
for (int j = 0; j >= -16; j--) {
pixo.fillScreen(0);
for (int i = 0; i < 256; i++) {
pixo.setPixelColor(i + (j * 16), mario[i][0], mario[i][1], mario[i][2]);
pixo.setPixelColor(i + (j * 16), patreon[i][0], patreon[i][1], patreon[i][2]);
}
pixo.show();
delay(15);
@@ -107,10 +189,7 @@ void notification() {
pixo.show();
}
float ballx = 5;
float bally = 5;
float paddle1, paddle2 = 3;
float ballvx = -0.3;
float ballvy = 0.1;
int numChar(char* array) {
return strlen(array);
}