Skip to content

Commit b498ecc

Browse files
Move example and add TFT
1 parent bab19df commit b498ecc

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed
File renamed without changes.

libraries/Fri3dBadge/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ paragraph=Arduino library for the Fri3d Camp 2024 badge
77
category=Other
88
url=https://github.com/Fri3dCamp/badge_2024_arduino
99
architectures=esp32
10-
depends=FastLED
10+
depends=Adafruit GFX Library,Adafruit NeoPixel,Adafruit ST7735 and ST7789 Library,FastLED
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <Fri3dBadge_TFT.h>
2+
3+
Fri3dBadge_TFT::Fri3dBadge_TFT() : Adafruit_ST7789(X_LCD_CS, X_LCD_DC, X_LCD_MOSI, X_LCD_CLK, X_LCD_RST);
4+
{
5+
6+
}
7+
8+
void Fri3dBadge_TFT::begin(uint32_t freq)
9+
{
10+
// Call the parent class's begin method to initialize the display
11+
Adafruit_ST7789::begin(freq);
12+
13+
14+
setRotation(1);
15+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef Fri3dBadge_TFT_h
2+
#define Fri3dBadge_TFT_h
3+
4+
#include <Adafruit_GFX.h> // Core graphics library
5+
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
6+
#include <SPI.h>
7+
8+
#define BADGE2020_TFT_CS 5
9+
#define BADGE2020_TFT_RST -1
10+
#define BADGE2020_TFT_DC 33
11+
12+
#define BADGE2020_ACC_ADDRESS 0x18
13+
#define BADGE2020_ACC_CTRL_REG5 0x25
14+
15+
class Fri3dBadge_TFT : public Adafruit_ST7789 {
16+
public:
17+
Fri3dBadge_TFT();
18+
private:
19+
20+
};
21+
22+
#endif

0 commit comments

Comments
 (0)