This commit is contained in:
Vivian Lim 2020-10-22 19:15:29 -07:00
parent c09bc8444e
commit ad88a6919f
2 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,7 @@
convert image so it can be rendered:
convert hello.png -depth 1 -type bilevel GRAY:hello.raw
convert ~/Pictures/pika-sm.png -resize 128x32! -depth 1 -type bilevel GRAY:- | dd of=/dev/ttyUSB0 bs=1 count=512
convert ~/Pictures/pika-sm.png -resize 128x32! -depth 1 -type bilevel GRAY:- | dd of=/dev/ttyUSB0 bs=1 count=512
echo "aaa" | convert -background black -fill white -size 128x32 -family "Tamzen" -antialias -depth 1 -pointsize 12 caption:@- GRAY: | dd of=/dev/ttyUSB0 bs=1 count=512

View File

@ -34,13 +34,17 @@ uint8_t thresholdsEdges[][32] = {
{14, 14, 14, 15, 15, 16, 17, 18, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 18, 17, 16, 15, 15, 14, 14, 14}
};
int thresholdForRow(int row, int peak, int minValue, double steepness, double center){
return max((int)(-1 * steepness * pow((row - center), 2) + peak), minValue);
}
void drawStatic(){
drawingStatic = true;
if (drawingStatic) {
for (int x = 0; x < 128; x++){
for (int y = 0; y < 32; y++){
if (random(0,20) >= thresholdsEdges[encoderPos % (sizeof(thresholdsEdges) / sizeof(thresholdsEdges[0]))][y]){
if (random(0,20) >= thresholdForRow(y, 20, 15, 0.005 + (0.01 * encoderPos), 16)){
display.drawPixel(x, y, SSD1306_WHITE);
}
}