From 29e6db9d38c0c564cffd0afd81f6d8a63be3a260 Mon Sep 17 00:00:00 2001 From: brunotic Date: Sat, 6 Jun 2020 18:26:48 +0200 Subject: [PATCH] hardware test hello world --- .../sketch_hardware_test.ino | 51 ++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/Software/sketch_hardware_test/sketch_hardware_test.ino b/Software/sketch_hardware_test/sketch_hardware_test.ino index 95c2b6e..bdb1623 100644 --- a/Software/sketch_hardware_test/sketch_hardware_test.ino +++ b/Software/sketch_hardware_test/sketch_hardware_test.ino @@ -1,9 +1,48 @@ -void setup() { - // put your setup code here, to run once: +#include +#include + +#ifdef U8X8_HAVE_HW_SPI +#include +#endif +#ifdef U8X8_HAVE_HW_I2C +#include +#endif + +U8G2_ST7920_128X64_1_HW_SPI u8g2(U8G2_R0, /* CS=*/ 10, /* reset=*/ 8); + +void setup(void) { + + /* U8g2 Project: SSD1306 Test Board */ + //pinMode(10, OUTPUT); + //pinMode(9, OUTPUT); + //digitalWrite(10, 0); + //digitalWrite(9, 0); + + /* U8g2 Project: T6963 Test Board */ + //pinMode(18, OUTPUT); + //digitalWrite(18, 1); + + /* U8g2 Project: KS0108 Test Board */ + //pinMode(16, OUTPUT); + //digitalWrite(16, 0); + + /* U8g2 Project: LC7981 Test Board, connect RW to GND */ + //pinMode(17, OUTPUT); + //digitalWrite(17, 0); + + /* U8g2 Project: Pax Instruments Shield: Enable Backlight */ + //pinMode(6, OUTPUT); + //digitalWrite(6, 0); + + u8g2.begin(); } -void loop() { - // put your main code here, to run repeatedly: - -} +void loop(void) { + u8g2.firstPage(); + do { + u8g2.setFont(u8g2_font_ncenB10_tr); + u8g2.drawStr(0,24,"Hello World!"); + } while ( u8g2.nextPage() ); + //delay(1000); +} \ No newline at end of file