Serial port to rectify odd and even check problems

This commit is contained in:
ZYQ-FEIYUE
2022-12-25 21:51:58 +08:00
parent 2a543d1139
commit 6b93931b0b
3 changed files with 32 additions and 53 deletions

View File

@@ -1,58 +1,37 @@
// base class GxEPD2_GFX can be used to pass references or pointers to the display instance as parameter, uses ~1.2k more code /*
// enable or disable GxEPD2_GFX base class Blink
#define ENABLE_GxEPD2_GFX 0
#include <GxEPD2_BW.h> Turns an LED on for one second, then off for one second, repeatedly.
#include <GxEPD2_3C.h>
#include <Fonts/FreeMonoBold9pt7b.h>
// ESP32-C3 SS=7,SCL(SCK)=4,SDA(MOSI)=6,BUSY=3,RST=2,DC=1 Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
GxEPD2_BW<GxEPD2_213_B74, GxEPD2_213_B74::HEIGHT> display(GxEPD2_213_B74(/*CS=5*/ SS, /*DC=*/ 1, /*RST=*/ 2, /*BUSY=*/ 3)); // GDEM0213B74 122x250, SSD1680 it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
//GxEPD2_3C<GxEPD2_213_Z98c, GxEPD2_213_Z98c::HEIGHT> display(GxEPD2_213_Z98c(/*CS=5*/ SS, /*DC=*/ 1, /*RST=*/ 2, /*BUSY=*/ 3)); // GDEY0213Z98 122x250, SSD1680 the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
https://www.arduino.cc/en/Main/Products
void setup() modified 8 May 2014
{ by Scott Fitzgerald
pinMode(8, OUTPUT); modified 2 Sep 2016
digitalWrite(8, HIGH); by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman
display.init(115200,true,50,false); This example code is in the public domain.
helloWorld();
display.hibernate(); https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
} */
const char HelloWorld[] = "Hello World!"; // the setup function runs once when you press reset or power the board
const char HelloWeACtStudio[] = "Hello WeAct Studio!"; void setup() {
// initialize digital pin LED_BUILTIN as an output.
void helloWorld() pinMode(PC13, OUTPUT);
{
display.setRotation(1);
display.setFont(&FreeMonoBold9pt7b);
display.setTextColor(GxEPD_BLACK);
int16_t tbx, tby; uint16_t tbw, tbh;
display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
// center the bounding box by transposition of the origin:
uint16_t x = ((display.width() - tbw) / 2) - tbx;
uint16_t y = ((display.height() - tbh) / 2) - tby;
display.setFullWindow();
display.firstPage();
do
{
display.fillScreen(GxEPD_WHITE);
display.setCursor(x, y-tbh);
display.print(HelloWorld);
display.setTextColor(display.epd2.hasColor ? GxEPD_RED : GxEPD_BLACK);
display.getTextBounds(HelloWeACtStudio, 0, 0, &tbx, &tby, &tbw, &tbh);
x = ((display.width() - tbw) / 2) - tbx;
display.setCursor(x, y+2*tbh);
display.print(HelloWeACtStudio);
}
while (display.nextPage());
} }
// the loop function runs over and over again forever
void loop() { void loop() {
// put your main code here, to run repeatedly: digitalWrite(PC13, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(8, HIGH); delay(1000); // wait for a second
delay(1000); digitalWrite(PC13, LOW); // turn the LED off by making the voltage LOW
digitalWrite(8, LOW); delay(1000); // wait for a second
delay(1000);
} }

View File

@@ -12,7 +12,7 @@
{ {
"name": "AT32F403ACGU7 Core Board", "name": "AT32F403ACGU7 Core Board",
"architecture": "at32f403a", "architecture": "at32f403a",
"version": "0.0.7", "version": "0.0.8",
"category": "Contributed", "category": "Contributed",
"url": "https://github.com/WeActStudio/ArduinoCore-AT32F4/archive/refs/heads/main.zip", "url": "https://github.com/WeActStudio/ArduinoCore-AT32F4/archive/refs/heads/main.zip",
"archiveFileName": "ArduinoCore-AT32F4-main.zip", "archiveFileName": "ArduinoCore-AT32F4-main.zip",

View File

@@ -1,6 +1,6 @@
##==============================================## ##==============================================##
name=WeActStudio AT32F403A Boards name=WeActStudio AT32F403A Boards
version=0.0.7 version=0.0.8
##==============================================## ##==============================================##
####AT32 compile variables ####AT32 compile variables