Files
SyncHome/trunk/Arduino/sketch_uno_Digole/sketch_uno_Digole.ino
2023-03-13 09:05:51 +00:00

42 lines
1.6 KiB
C++

/* **************************************** *
* Title *
* **************************************** *
* (C) 201x-xx-xx Paolo Iocco *
* rev. 0.x *
* **************************************** *
* Circuit diagram
* ---------------
*
* ***************************************** */
#define _Digole_Serial_SPI_
#include <DigoleSerial.h>
#define led 13
#define OLED_Data 8
#define OLED_Clk 9
DigoleSerialDisp mydisp(OLED_Data, OLED_Clk, 255); //SPI:Pin 1: data, 2:clock, 10: SS, you can assign 255 to SS, and hard ground SS pin on module
// the setup routine runs once when you press reset:
void setup() {
pinMode(led, OUTPUT); // initialize the digital pin as an output.
delay(4200);
mydisp.begin();
/*----------for text LCD adapter and graphic LCD adapter ------------*/
mydisp.clearScreen(); //CLear screen
//mydisp.displayConfig(1); //set config display ON, 0=off
//mydisp.setLCDColRow(16,2); //set LCD Col and Row, only time set up is OK
mydisp.disableCursor(); //disable cursor, enable cursore use: enableCursor();
mydisp.drawStr(0, 0, "* Love Silvia *"); //display string at: x=0, y=0
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
mydisp.enableCursor();
delay(250); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
mydisp.disableCursor();
delay(750); // wait for a second
}