idk
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "index.h"
|
#include "index.h"
|
||||||
#include "fonts.h"
|
#include "fonts.h"
|
||||||
#include "lowLevel.ino"
|
#include "lowLevel.h"
|
||||||
|
|
||||||
#ifdef __AVR__
|
#ifdef __AVR__
|
||||||
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
|
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
|
||||||
@@ -20,7 +20,7 @@ void setup()
|
|||||||
|
|
||||||
pixels.begin();
|
pixels.begin();
|
||||||
pixels.clear();
|
pixels.clear();
|
||||||
|
drawCharacter(font7x5['A' - '!'], 7, 5, 0x00010101, &cursor1);
|
||||||
pixels.show();
|
pixels.show();
|
||||||
start_server();
|
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
|
||||||
|
|
||||||
+6
-6
@@ -1,8 +1,6 @@
|
|||||||
#include "config.h"
|
#include "lowLevel.h"
|
||||||
#include "structs.h"
|
|
||||||
|
|
||||||
unsigned char saved_images_count = 0;
|
unsigned char saved_images_count = 0;
|
||||||
|
|
||||||
Cursor cursor1;
|
Cursor cursor1;
|
||||||
|
|
||||||
uint32_t saved_imaged[2][16][16] =
|
uint32_t saved_imaged[2][16][16] =
|
||||||
@@ -108,8 +106,8 @@ void drawCharacter(const bool (*character)[5], unsigned char height, unsigned ch
|
|||||||
{
|
{
|
||||||
if (character[row][col])
|
if (character[row][col])
|
||||||
{
|
{
|
||||||
unsigned short pixel_x = col + used_cursor.x;
|
unsigned short pixel_x = col + used_cursor->x;
|
||||||
unsigned short pixel_y = row + used_cursor.y;
|
unsigned short pixel_y = row + used_cursor->y;
|
||||||
|
|
||||||
if (pixel_x >= 0 && pixel_x < NUMPIXELS &&
|
if (pixel_x >= 0 && pixel_x < NUMPIXELS &&
|
||||||
pixel_y >= 0 && pixel_y < NUMPIXELS)
|
pixel_y >= 0 && pixel_y < NUMPIXELS)
|
||||||
@@ -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)
|
void fillPixels(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, uint32_t color)
|
||||||
@@ -172,3 +170,5 @@ void shiftGivenRectangle(unsigned short x1, unsigned short y1, unsigned short x2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#ifndef STRUCTS_H
|
||||||
|
#define STRUCTS_H
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
struct Cursor
|
struct Cursor
|
||||||
@@ -32,3 +35,6 @@ struct Text
|
|||||||
|
|
||||||
Text() : color(0), pos_x(0), pos_y(0), character_count(0), characterSize({7,5}), deleted(true) {}
|
Text() : color(0), pos_x(0), pos_y(0), character_count(0), characterSize({7,5}), deleted(true) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // STRUCTS_H
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user