mirror of
https://github.com/geekammo/MicroView-Arduino-Library.git
synced 2026-03-03 08:44:05 +01:00
added invert function, contrast function, changed scrollStop to scrollStop for consistency
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
#include <MicroView.h>
|
||||
#include <Time.h>
|
||||
|
||||
//#define PI 3.141592654
|
||||
#define clocksize 24
|
||||
|
||||
uint8_t onDelay=5; // This is the on delay in milliseconds, if there is no on delay, the erase will be too fast to clean up the screen.
|
||||
uint8_t onDelay=5; // this is the on delay in milliseconds, if there is no on delay, the erase will be too fast to clean up the screen.
|
||||
|
||||
void setup() {
|
||||
uView.begin(); // Begin of MicroView
|
||||
uView.clear(ALL); // Erase hardware memory inside the OLED controller
|
||||
uView.display(); // Display the content in the buffer memory, by default it is the MicroView logo
|
||||
uView.begin(); // begin of MicroView
|
||||
uView.clear(ALL); // erase hardware memory inside the OLED controller
|
||||
uView.display(); // display the content in the buffer memory, by default it is the MicroView logo
|
||||
setTime(10,10,01,17,1,2014);
|
||||
delay(500);
|
||||
uView.clear(PAGE); // Erase the memory buffer, when next uView.display() is called, the OLED will be cleared.
|
||||
uView.clear(PAGE); // erase the memory buffer, when next uView.display() is called, the OLED will be cleared.
|
||||
}
|
||||
|
||||
void loop() {
|
||||
@@ -261,8 +260,6 @@ void loop() {
|
||||
}
|
||||
}
|
||||
uView.clear(PAGE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,39 +1,30 @@
|
||||
#include <SPI.h>
|
||||
#include <MicroView.h>
|
||||
|
||||
MicroViewWidget *widget[4];
|
||||
|
||||
void setup() {
|
||||
|
||||
widget[0] = new MicroViewSlider(0,0,0,100);
|
||||
widget[1] = new MicroViewSlider(0,10,0,150);
|
||||
widget[2] = new MicroViewSlider(0,20,0,50);
|
||||
widget[3] = new MicroViewSlider(0,30,0,200);
|
||||
Serial.begin(115200);
|
||||
Serial.println("start");
|
||||
uView.begin();
|
||||
uView.clear(PAGE);
|
||||
widget[0]->draw();
|
||||
widget[1]->draw();
|
||||
widget[2]->draw();
|
||||
widget[3]->draw();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
for (int i=0;i<101;i++) {
|
||||
widget[0]->setValue(i);
|
||||
widget[1]->setValue(100-i);
|
||||
widget[2]->setValue(i);
|
||||
widget[3]->setValue(100-i);
|
||||
uView.display();
|
||||
}
|
||||
|
||||
for(int i=100; i>-1;i--) {
|
||||
widget[0]->setValue(i);
|
||||
widget[1]->setValue(100-i);
|
||||
widget[2]->setValue(i);
|
||||
widget[3]->setValue(100-i);
|
||||
uView.display();
|
||||
}
|
||||
|
||||
#include <MicroView.h>
|
||||
|
||||
MicroViewWidget *widget[4]; // declaring an array of 4 MicroViewWidget
|
||||
|
||||
void setup() {
|
||||
uView.begin(); // init and start MicroView
|
||||
uView.clear(PAGE); // erase the memory buffer, when next uView.display() is called, the OLED will be cleared.
|
||||
widget[0] = new MicroViewSlider(0,0,0,100); // declare widget0 as a Slider at x=0, y=0, min=0, max=100
|
||||
widget[1] = new MicroViewSlider(0,10,0,150); // declare widget0 as a Slider at x=0, y=10, min=0, max=150
|
||||
widget[2] = new MicroViewSlider(0,20,0,50); // declare widget0 as a Slider at x=0, y=20, min=0, max=50
|
||||
widget[3] = new MicroViewSlider(0,30,0,200); // declare widget0 as a Slider at x=0, y=30, min=0, max=200
|
||||
}
|
||||
|
||||
void loop() {
|
||||
for (int i=0;i<=100;i++) {
|
||||
widget[0]->setValue(i); // set value i to widget0
|
||||
widget[1]->setValue(100-i);
|
||||
widget[2]->setValue(i);
|
||||
widget[3]->setValue(100-i);
|
||||
uView.display();
|
||||
}
|
||||
|
||||
for(int i=100; i>=0;i--) {
|
||||
widget[0]->setValue(i);
|
||||
widget[1]->setValue(100-i);
|
||||
widget[2]->setValue(i);
|
||||
widget[3]->setValue(100-i);
|
||||
uView.display();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user