ladyada / adafruit_characteroled Goto Github PK
View Code? Open in Web Editor NEWAdafruit 'Liquid Crystal' compatible libary for Character OLEDs
Adafruit 'Liquid Crystal' compatible libary for Character OLEDs
The source code mentions it would handle warm starts. But in my case, most of the time it shows some "greek" alpha and x characters after a restart and nothing else happens.
Is there some way to fix that?
( I am using the spark core and the adafruit 16x2 oled display)
Just using the provided example sketch HelloOLEDWorld gives:
F:\Documents\Arduino\libraries\Adafruit_CharacterO LED-master\Adafruit_CharacterOLED.cpp:66:101: warning: default argument given for parameter 3 of 'void Adafruit_CharacterOLED::begin(uint8_t, uint8_t, uint8_t)' [-fpermissive]
void Adafruit_CharacterOLED::begin(uint8_t cols, uint8_t lines, uint8_t character_set = LCD_JAPANESE)
^
In file included from F:\Documents\Arduino\libraries\Adafruit_CharacterO LED-master\Adafruit_CharacterOLED.cpp:7:0:
F:\Documents\Arduino\libraries\Adafruit_CharacterO LED-master\Adafruit_CharacterOLED.h:58:8: note: previous specification in 'void Adafruit_CharacterOLED::begin(uint8_t, uint8_t, uint8_t)' here
void begin(uint8_t cols, uint8_t rows, uint8_t character_set = LCD_JAPANESE);
^
F:\Documents\Arduino\libraries\Adafruit_CharacterO LED-master\Adafruit_CharacterOLED.cpp: In member function 'virtual size_t Adafruit_CharacterOLED::write(uint8_t)':
F:\Documents\Arduino\libraries\Adafruit_CharacterO LED-master\Adafruit_CharacterOLED.cpp:244:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
in the cpp file, changing void Adafruit_CharacterOLED::begin(uint8_t cols, uint8_t lines, uint8_t character_set = LCD_JAPANESE)
to
void Adafruit_CharacterOLED::begin(uint8_t cols, uint8_t lines, uint8_t character_set)
fixes the first warning (should I have to do this???) but the warning still remails:
F:\Documents\Arduino\libraries\Adafruit_CharacterOLED-master\Adafruit_CharacterOLED.cpp: In member function 'virtual size_t Adafruit_CharacterOLED::write(uint8_t)':
F:\Documents\Arduino\libraries\Adafruit_CharacterOLED-master\Adafruit_CharacterOLED.cpp:244:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
Is this a bug or what should I do? Thanks
When i try to compile this lib using a compiler optimization flag other than Arduino default -Os. For example when using -Ofast
I get the following error, which is if I understand it correctly a problem with the library :
In function
global constructors keyed to 65535_0_Device.cpp.o.6022':
:(.text.startup+0x7d4): undefined reference to `Adafruit_CharacterOLED::command(unsigned char)'
`
If you use lcd.cursor(); the screen goes black
The library seems to use the ENGLISH_JAPANESE character font table and I can't figure out how to change it to WESTERN EUROPEAN.
To demo this, do a
oled.print((char)0xfd);
The rendered char is the "divide sign" (ENGLISH_JAPANESE) instead of the "tall lowercase u" (WESTERN EUROPEAN).
See WS0010 docs pages 5 & 6, right-most column, 3rd to last row.
I tried monkeying with Adafruit_CharacterOLED::begin() but couldn't figure out which instruction sets the Font Table.
I thought it might be this at line 97:
write4bits(0x08);
where the 2 LSB are 00 (FT1:0 = ENGLISH_JAPANESE) and tried setting this to
write4bits(0x09);
where the 2 LSB are 01 (FT1:0 = WESTERN EUROPEAN)
but the display reboots to displaying garbage, so that doesn't seem to be it.
Hi
I've found problem and I can't use RX from MIDI.h library at all
TX works.
I tested and I found that this function causes problem of RX pins in all Serial0, 1, 2, 3
void Adafruit_CharacterOLED::waitForReady(void)
{
unsigned char busy = 1;
pinMode(_busy_pin, INPUT);
digitalWrite(_rs_pin, LOW);
digitalWrite(_rw_pin, HIGH);
do
{
digitalWrite(_enable_pin, LOW);
digitalWrite(_enable_pin, HIGH);
delayMicroseconds(10);
busy = digitalRead(_busy_pin);
digitalWrite(_enable_pin, LOW);
pulseEnable(); // get remaining 4 bits, which are not used.
}
while(busy);
pinMode(_busy_pin, OUTPUT);
digitalWrite(_rw_pin, LOW);
}
and this is simple code to check the problem:
#include <MIDI.h>
#include <Adafruit_CharacterOLED.h>
Adafruit_CharacterOLED lcd(OLED_V2, 22, 24, 26, 28, 30, 32, 34);
MIDI_CREATE_DEFAULT_INSTANCE();
bool LED=false;
void setup()
{
MIDI.begin(MIDI_CHANNEL_OMNI); // Listen to all incoming messages
MIDI.setHandleNoteOn(MyNoteOnFunction);
MIDI.setHandleNoteOff(MyNoteOffFunction);
pinMode(10,OUTPUT);
}
void loop()
{
// Read incoming messages
MIDI.read();
if (LED==true)
{
digitalWrite(10,HIGH);//turn on led
}
}
void MyNoteOnFunction (byte channel, byte note, byte velocity)
{
LED=true;
}
void MyNoteOffFunction (byte channel, byte note, byte velocity)
{
}
}
Standard library LiquidCrystal works correctly and of course it doesn't have that function.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.