idk
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include "config.h"
|
||||
#include "index.h"
|
||||
#include "fonts.h"
|
||||
#include "lowLevel.ino"
|
||||
#include "lowLevel.h"
|
||||
|
||||
#ifdef __AVR__
|
||||
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
|
||||
@@ -20,7 +20,7 @@ void setup()
|
||||
|
||||
pixels.begin();
|
||||
pixels.clear();
|
||||
|
||||
drawCharacter(font7x5['A' - '!'], 7, 5, 0x00010101, &cursor1);
|
||||
pixels.show();
|
||||
start_server();
|
||||
}
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
#ifndef LOWLEVEL_H
|
||||
#define LOWLEVEL_H
|
||||
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
#include "config.h"
|
||||
#include "structs.h"
|
||||
|
||||
extern Adafruit_NeoPixel pixels;
|
||||
extern unsigned char saved_images_count;
|
||||
extern Cursor cursor1;
|
||||
extern uint32_t saved_imaged[2][16][16];
|
||||
|
||||
// Function declarations
|
||||
void setPixel(unsigned short x, unsigned short y, uint32_t color);
|
||||
uint32_t getPixelColor(unsigned short x, unsigned short y);
|
||||
void drawImageFromSaved(unsigned short offset_x, unsigned short offset_y, unsigned char i);
|
||||
void drawCharacter(const bool (*character)[5], unsigned char height, unsigned char width, uint32_t color, Cursor (*used_cursor));
|
||||
void fillPixels(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, uint32_t color);
|
||||
void shiftGivenRectangle(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned char shift_by);
|
||||
|
||||
#endif // LOWLEVEL_H
|
||||
|
||||
+11
-11
@@ -1,8 +1,6 @@
|
||||
#include "config.h"
|
||||
#include "structs.h"
|
||||
#include "lowLevel.h"
|
||||
|
||||
unsigned char saved_images_count = 0;
|
||||
|
||||
Cursor cursor1;
|
||||
|
||||
uint32_t saved_imaged[2][16][16] =
|
||||
@@ -90,8 +88,8 @@ void drawImageFromSaved(unsigned short offset_x, unsigned short offset_y, unsign
|
||||
}
|
||||
unsigned short pixel_x = col + offset_x;
|
||||
unsigned short pixel_y = row + offset_y;
|
||||
|
||||
if (pixel_x >= 0 && pixel_x < NUMPIXELS &&
|
||||
|
||||
if (pixel_x >= 0 && pixel_x < NUMPIXELS &&
|
||||
pixel_y >= 0 && pixel_y < NUMPIXELS)
|
||||
{
|
||||
setPixel(pixel_x, pixel_y, px_color);
|
||||
@@ -108,10 +106,10 @@ void drawCharacter(const bool (*character)[5], unsigned char height, unsigned ch
|
||||
{
|
||||
if (character[row][col])
|
||||
{
|
||||
unsigned short pixel_x = col + used_cursor.x;
|
||||
unsigned short pixel_y = row + used_cursor.y;
|
||||
|
||||
if (pixel_x >= 0 && pixel_x < NUMPIXELS &&
|
||||
unsigned short pixel_x = col + used_cursor->x;
|
||||
unsigned short pixel_y = row + used_cursor->y;
|
||||
|
||||
if (pixel_x >= 0 && pixel_x < NUMPIXELS &&
|
||||
pixel_y >= 0 && pixel_y < NUMPIXELS)
|
||||
{
|
||||
setPixel(pixel_x, pixel_y, color);
|
||||
@@ -119,7 +117,7 @@ void drawCharacter(const bool (*character)[5], unsigned char height, unsigned ch
|
||||
}
|
||||
}
|
||||
}
|
||||
used_cursor.x += width + 1;
|
||||
used_cursor->x += width + 1;
|
||||
}
|
||||
|
||||
void fillPixels(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, uint32_t color)
|
||||
@@ -171,4 +169,6 @@ void shiftGivenRectangle(unsigned short x1, unsigned short y1, unsigned short x2
|
||||
setPixel(x1 + j, y1 + i, 0x00000000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user