updating
This commit is contained in:
11
stage2/include/colors.h
Normal file
11
stage2/include/colors.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// Color definitions
|
||||
#define BLACK 0x0000
|
||||
#define BLUE 0x001F
|
||||
#define RED 0xF800
|
||||
#define GREEN 0x07E0
|
||||
#define CYAN 0x07FF
|
||||
#define MAGENTA 0xF81F
|
||||
#define YELLOW 0xFFE0
|
||||
#define WHITE 0xFFFF
|
||||
@@ -1,5 +1,16 @@
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
#include <Adafruit_GFX.h>
|
||||
#include <Adafruit_ILI9341.h>
|
||||
#include <Fonts/FreeSans12pt7b.h>
|
||||
|
||||
#include "colors.h"
|
||||
|
||||
#define TFT_CS 9
|
||||
#define TFT_DC 10
|
||||
#define BACKGROUND_COLOR 0xDEFB
|
||||
#define FOREGROUND_COLOR BLACK
|
||||
|
||||
Adafruit_ILI9341 tft(TFT_CS, TFT_DC);
|
||||
|
||||
Adafruit_NeoPixel pixels(1, 11, NEO_GRB + NEO_KHZ800);
|
||||
auto cOff = pixels.Color(0, 0, 0);
|
||||
@@ -15,6 +26,19 @@ setup()
|
||||
pixels.begin();
|
||||
pixels.clear();
|
||||
pixels.show();
|
||||
|
||||
tft.begin();
|
||||
tft.setRotation(1);
|
||||
tft.setTextSize(1);
|
||||
tft.setCursor(0, 8);
|
||||
|
||||
tft.fillScreen(BACKGROUND_COLOR);
|
||||
tft.setTextColor(FOREGROUND_COLOR);
|
||||
|
||||
tft.println(" \\ (define square (x) (* x ))");
|
||||
tft.println(" \\ (square 3)");
|
||||
tft.println(" 9");
|
||||
tft.println(" \\ ");
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +74,7 @@ pixelOn(uint32_t c)
|
||||
pixels.show();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pixelOff()
|
||||
{
|
||||
@@ -64,4 +89,5 @@ loop()
|
||||
static bool on = false;
|
||||
|
||||
on = blink(on);
|
||||
delayMicroseconds(100);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user