terokorp / displayshield4d Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/displayshield4d
Automatically exported from code.google.com/p/displayshield4d
DisplayShield4D - Arduino Library for 4Display-Shield by 4D Systems Copyright(c) December 2010 Oscar Gonzalez - www.BricoGeek.com Licensed under GNU General Public License v3 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 16bitColor from RGB by YAPAN.org's small utilities for Arduino http://www.opensource.org/licenses/bsd-license.php Arduino DisplayShield4d Library: ============================================================================ Download latest source of the library at: http://code.google.com/p/displayshield4d/ Instalation ============================================================================ Open the zip file and copy the "displayshield4d" to your arduino install dir /libraries Tested on the Arduino IDE 0021 General information ============================================================================ All these shields comes with the SGC serial firmware, but in order to get latest version, please check the 4D Systems website.
When using your library with Arduino version 1.0 on a Windows 7 machine I get
the following errors:
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:25:22: error:
WProgram.h: No such file or directory
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::Init()':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:46: error:
'OUTPUT' was not declared in this scope
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:46: error:
'pinMode' was not declared in this scope
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:48: error:
'delay' was not declared in this scope
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:49: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::Reset()':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:118: error:
'LOW' was not declared in this scope
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:118: error:
'digitalWrite' was not declared in this scope
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:119: error:
'delay' was not declared in this scope
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:120: error:
'HIGH' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::Clear()':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:133: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::GetReply()':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:147: error:
'byte' was not declared in this scope
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:147: error:
expected `;' before 'incomingByte'
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:148: error:
'Serial' was not declared in this scope
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:148: error:
'delayMicroseconds' was not declared in this scope
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:149: error:
'incomingByte' was not declared in this scope
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:149: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::SetPenSize(char)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:184: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::SetBackground(unsigned int)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:201: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::SetContrast(char)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:221: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::SetState(char)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:240: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::Sleep(char)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:259: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::ScreenCopy(uint8_t, uint8_t,
uint8_t, uint8_t, uint8_t, uint8_t)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:279: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::putpixel(uint8_t, uint8_t,
unsigned int)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:303: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint16_t DisplayShield4d::readpixel(uint8_t, uint8_t)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:324: error:
'Serial' was not declared in this scope
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:328: error:
'delayMicroseconds' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::line(uint8_t, uint8_t, uint8_t,
uint8_t, unsigned int)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:345: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::rectangle(uint8_t, uint8_t,
uint8_t, uint8_t, char, unsigned int)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:375: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::circle(uint8_t, uint8_t, uint8_t,
uint8_t, unsigned int)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:404: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::triangle(uint8_t, uint8_t,
uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, unsigned int)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:433: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::setfont(uint8_t)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:462: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::setfontmode(uint8_t)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:480: error:
'Serial' was not declared in this scope
D:\Bin\Arduino Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:
In member function 'uint8_t DisplayShield4d::drawstringblock(uint8_t, uint8_t,
uint8_t, unsigned int, uint8_t, uint8_t, char*)':
D:\Bin\Arduino
Stuff\arduino-1.0\libraries\displayshield4d\displayshield4d.cpp:499: error:
'Serial' was not declared in this scope
The same code compiles and uploads fine under Arduino 0.22
Original issue reported on code.google.com by [email protected]
on 6 Dec 2011 at 6:40
Does not work out of the box
Need to modify code to something like
Serial1.begin(9600); // ONLY INIT @ 9600
//Copied reset from LIB
digitalWrite(OLED_RESETPIN, LOW);
delay(10);
digitalWrite(OLED_RESETPIN, HIGH);
delay(10);
delay(500); //32PT only requires 500ms wait not 1 second
Serial1.write(0x55); //Send autobaud
incomingByte = OLED_NACK;
while (!Serial1.available()) { delayMicroseconds(50); }
incomingByte = Serial1.read();
if (incomingByte = OLED_ACK) //ACK Recieved ofr Autobaud
{
delay(100);
Serial1.write(0x51); //CMD, Set new BAUD
Serial1.write(0x0D); //RATE, 115200
while (!Serial1.available()) { delayMicroseconds(50); }
incomingByte = Serial1.read();
if (incomingByte = OLED_ACK) //BAUD CHANGE OK!
{
Serial1.end(); //KILL SERIAL 1
delay(50); //WAIT A BIT
Serial1.begin(115000); //START AT 115
}
}
If to Serial1.begin(115200); it does not work for some reason, anything
higher than that on this uLCD does not work- maybe I am thick and doing
something wrong.
But i init the uLCD-32PT like this and i can draw lines of pixels in the blink
of an eye.
This lib out of the box does not init the 32PT, also something wierd is
happening with drawstringblock- the font string, width1 = the whole screen? i 1
on the whole screen and the rest of the string is gone.
I dont know how to fix it.
Original issue reported on code.google.com by [email protected]
on 17 Sep 2011 at 9:04
To patch the problem, just open displayshield4d.cpp and replace
#include "WProgram.h"
by this :
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
Now, it works with all Arduino versions ;)
Original issue reported on code.google.com by [email protected]
on 22 Dec 2012 at 10:22
There is a duplicated declaration of RESET_PIN in displayshield4d.h
Original issue reported on code.google.com by [email protected]
on 16 Dec 2010 at 9:31
#define OLED_BAUDRATE not used??
Header to go with setBaud()
DEFINED
OLED_SETBAUDRATE
OLED_BAUD9600 -> OLED_BAUD256000 (just common ones)
Original issue reported on code.google.com by [email protected]
on 17 Sep 2011 at 7:34
Attachments:
:\Users\my\Documents\Arduino\libraries\ServoShield\ServoShield.cpp: In
constructor 'ServoShield::ServoShield()':
C:\Users\my\Documents\Arduino\libraries\ServoShield\ServoShield.cpp:173: error:
'OUTPUT' was not declared in this scope
C:\Users\my\Documents\Arduino\libraries\ServoShield\ServoShield.cpp:173: error:
'pinMode' was not declared in this scope
C:\Users\my\Documents\Arduino\libraries\ServoShield\ServoShield.cpp: In member
function 'int ServoShield::start()':
C:\Users\my\Documents\Arduino\libraries\ServoShield\ServoShield.cpp:231: error:
'HIGH' was not declared in this scope
C:\Users\my\Documents\Arduino\libraries\ServoShield\ServoShield.cpp:231: error:
'digitalWrite' was not declared in this scope
C:\Users\my\Documents\Arduino\libraries\ServoShield\ServoShield.cpp:248: error:
'LOW' was not declared in this scope
i set the servo library correctly i have changed the wprogram.h to arduino.h
but still no use
Original issue reported on code.google.com by [email protected]
on 13 May 2014 at 3:41
Attachments:
Hi,
I would like to use this lib with an Arduino Mega 2560. In addition to Serial,
this one has Serial1,Serial2,Serial3. To not interfere with host communication,
I would like to connect the OLED board to a serial that is different from
Serial.
Proposal: Add optional argument to constructor
DisplayShield4d(HardwareSerial& serial=Serial);
/// Additional Support for SoftwareSerial
DisplayShield4d(Software& serial);
Excellent work!
Georg
Original issue reported on code.google.com by [email protected]
on 26 Dec 2010 at 9:26
Added SetBaud()
Original issue reported on code.google.com by [email protected]
on 17 Sep 2011 at 7:28
Attachments:
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.