Skillnad mellan versioner av "Grove - OLED Display 1.12""
Rad 6: | Rad 6: | ||
== Port == | == Port == | ||
* I2C | * I2C | ||
+ | |||
+ | == Bibliotek == | ||
+ | https://github.com/Seeed-Studio/OLED_Display_96X96/archive/master.zip | ||
== Exempelkod == | == Exempelkod == | ||
=== Arduino === | === Arduino === | ||
<syntaxhighlight lang="C++" line> | <syntaxhighlight lang="C++" line> | ||
+ | #include <Wire.h> | ||
+ | #include <SeeedGrayOLED.h> | ||
+ | #include <avr/pgmspace.h> | ||
+ | void setup() | ||
+ | { | ||
+ | Wire.begin(); | ||
+ | SeeedGrayOled.init(SSD1327); //initialize SEEED OLED display | ||
+ | SeeedGrayOled.clearDisplay(); //Clear Display. | ||
+ | SeeedGrayOled.setNormalDisplay(); //Set Normal Display Mode | ||
+ | SeeedGrayOled.setVerticalMode(); // Set to vertical mode for displaying text | ||
+ | |||
+ | for(char i=0; i < 12 ; i++) | ||
+ | { | ||
+ | SeeedGrayOled.setTextXY(i,0); //set Cursor to ith line, 0th column | ||
+ | SeeedGrayOled.setGrayLevel(i); //Set Grayscale level. Any number between 0 - 15. | ||
+ | SeeedGrayOled.putString("Hello World"); //Print Hello World | ||
+ | } | ||
+ | } | ||
+ | void loop() | ||
+ | { | ||
+ | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Versionen från 26 oktober 2018 kl. 20.04
Kompatibilitet
- Arduino
- Raspberry Pi
Port
- I2C
Bibliotek
https://github.com/Seeed-Studio/OLED_Display_96X96/archive/master.zip
Exempelkod
Arduino
#include <Wire.h>
#include <SeeedGrayOLED.h>
#include <avr/pgmspace.h>
void setup()
{
Wire.begin();
SeeedGrayOled.init(SSD1327); //initialize SEEED OLED display
SeeedGrayOled.clearDisplay(); //Clear Display.
SeeedGrayOled.setNormalDisplay(); //Set Normal Display Mode
SeeedGrayOled.setVerticalMode(); // Set to vertical mode for displaying text
for(char i=0; i < 12 ; i++)
{
SeeedGrayOled.setTextXY(i,0); //set Cursor to ith line, 0th column
SeeedGrayOled.setGrayLevel(i); //Set Grayscale level. Any number between 0 - 15.
SeeedGrayOled.putString("Hello World"); //Print Hello World
}
}
void loop()
{
}