-
-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from lovyan03/develop
0.2.5
- Loading branch information
Showing
23 changed files
with
1,703 additions
and
762 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
_ _ _ _ _ _ _ _ _ _ _ _ _ R R R R R R R _ _ _ _ _ _ _ _ _ _ _ _ _ | ||
_ _ _ _ _ _ _ _ _ _ _ R R R R R R R R R R R _ _ _ _ _ _ _ _ _ _ _ | ||
_ _ _ _ _ _ _ _ _ _ R R R R R R R R R R R R R _ _ _ _ _ _ _ _ _ _ | ||
_ _ _ _ _ _ _ _ _ R R R R _ _ _ _ _ _ R R R R R _ _ _ _ _ _ _ _ _ | ||
_ _ _ _ _ _ _ _ R R R R R _ _ R R R _ _ R R R R R _ _ _ _ _ _ _ _ | ||
_ _ _ _ _ _ _ _ R R R R R _ _ R R R _ _ R R R R R _ _ _ _ _ _ _ _ | ||
_ _ _ _ _ _ _ R R R R R R _ _ _ _ _ _ R R R R R R R _ _ _ _ _ _ _ | ||
_ _ _ _ _ _ _ R R R R R R _ _ R R _ _ R R R R R R R _ _ _ _ _ _ _ | ||
_ _ _ _ _ _ _ R R R R R R _ _ R R R _ _ R R R R R R _ _ _ _ _ _ _ | ||
_ _ _ _ _ _ _ R R R R R R _ _ R R R _ _ R R R R R R _ _ _ _ _ _ _ | ||
_ _ _ _ _ _ _ R R R R R R _ _ R R R _ _ R R R R R R _ _ _ _ _ _ _ | ||
_ _ _ _ _ _ _ R R R R R R R R R R R R R R R R R R R _ _ _ _ _ _ _ | ||
_ _ _ _ _ _ G Y Y Y Y Y Y R R R R R R R M M M M M M B _ _ _ _ _ _ | ||
_ _ _ _ G G G G Y Y Y Y Y Y Y R R R M M M M M M M B B B B _ _ _ _ | ||
_ _ _ G G G G G Y Y Y Y Y Y Y Y R M M M M M M M M B B B B B _ _ _ | ||
_ _ G G G G G G G Y Y Y Y Y Y Y W M M M M M M M B B B B B B B _ _ | ||
_ G G G G G G G G G Y Y Y Y Y W W W M M M M M B B B B B B B B B _ | ||
_ G G G G G G G G G G Y Y Y Y W W W M M M M B B B B B B B B B B _ | ||
G G G G G G G G G G G G G Y W W W W W M B B B B B B B B B B B B B | ||
G G G G G _ _ _ _ G G G G G C C C C C B B B B _ _ _ _ _ B B B B B | ||
G G G G _ _ G G _ _ G G G G C C C C C B B B B _ _ B B _ _ B B B B | ||
G G G G _ _ G G G G G G G G C C C C C B B B B _ _ B B _ _ B B B B | ||
G G G G _ _ G G G G G G G G C C C C C B B B B _ _ _ _ _ B B B B B | ||
G G G G _ _ G _ _ _ G G G G C C C C C B B B B _ _ B B _ _ B B B B | ||
G G G G _ _ G G _ _ G G G G C C C C C B B B B _ _ B B _ _ B B B B | ||
_ G G G _ _ G G _ _ G G G G G C C C B B B B B _ _ B B _ _ B B B _ | ||
_ G G G G _ _ _ _ G G G G G G C C C B B B B B _ _ _ _ _ B B B B _ | ||
_ _ G G G G G G G G G G G G G G C B B B B B B B B B B B B B B _ _ | ||
_ _ _ G G G G G G G G G G G G G _ B B B B B B B B B B B B B _ _ _ | ||
_ _ _ _ G G G G G G G G G G G _ _ _ B B B B B B B B B B B _ _ _ _ | ||
_ _ _ _ _ _ G G G G G G G _ _ _ _ _ _ _ B B B B B B B _ _ _ _ _ _ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#if defined (ARDUINO_WIO_TERMINAL) | ||
#include <Seeed_FS.h> | ||
#include <SD/Seeed_SD.h> | ||
#else | ||
#include <SD.h> | ||
#include <SPIFFS.h> | ||
#endif | ||
|
||
#include <LovyanGFX.hpp> | ||
|
||
static LGFX lcd; | ||
|
||
static constexpr char filename[] = "/lovyangfx_test.png"; | ||
|
||
#ifndef SDCARD_SS_PIN | ||
#define SDCARD_SS_PIN 4 | ||
#endif | ||
|
||
#ifndef SDCARD_SPI | ||
#define SDCARD_SPI SPI | ||
#endif | ||
|
||
|
||
bool saveToSD() | ||
{ | ||
// createPng関数で指定範囲の画像からPNG形式のデータを生成します。 | ||
// SAMD51の場合 172x172程度が上限です。 | ||
// ESP32の場合 192x192程度が上限です。 | ||
// メモリ使用状況によってさらに縮みます。 | ||
// ESP32でPSRAMが有効な場合は大きなサイズでも保存できる可能性があります。 | ||
std::size_t dlen; | ||
std::uint8_t* png = (std::uint8_t*)lcd.createPng(&dlen, 0, 0, 128, 128); | ||
if (!png) | ||
{ | ||
Serial.print("error:createPng\n"); | ||
return false; | ||
} | ||
|
||
Serial.print("success:createPng\n"); | ||
|
||
bool result = false; | ||
File file = SD.open(filename, "w"); | ||
if (file) | ||
{ | ||
file.write((std::uint8_t*)png, dlen); | ||
file.close(); | ||
result = true; | ||
} | ||
else | ||
{ | ||
Serial.print("error:file open failure\n"); | ||
} | ||
|
||
free(png); | ||
return result; | ||
} | ||
|
||
void setup() | ||
{ | ||
lcd.init(); | ||
|
||
Serial.begin(115200); | ||
|
||
lcd.setColorDepth(24); | ||
|
||
lcd.setColor(TFT_WHITE); | ||
lcd.startWrite(); | ||
for (int x = 0; x < 128; ++x) | ||
{ | ||
for (int y = 0; y < 128; ++y) | ||
{ | ||
lcd.writePixel(x, y, lcd.color888(x << 1, x + y, y << 1)); | ||
} | ||
} | ||
lcd.print("PNG save test\n"); | ||
lcd.endWrite(); | ||
|
||
do { | ||
SD.end(); | ||
delay(1000); | ||
|
||
SD.begin(SDCARD_SS_PIN, SDCARD_SPI, 25000000); | ||
|
||
} while (!saveToSD()); | ||
|
||
|
||
lcd.print("PNG save success."); | ||
} | ||
|
||
void loop(void) | ||
{ | ||
delay(1000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name=LovyanGFX | ||
version=0.2.4 | ||
version=0.2.5 | ||
author=lovyan03 | ||
maintainer=Lovyan <[email protected]> | ||
sentence=LCD Graphics driver with touch for ESP32 and SAMD51 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.