added readme, fixed examples, etc!
This commit is contained in:
parent
7ba85ff98f
commit
b6c1182fd9
6 changed files with 121 additions and 12 deletions
|
|
@ -1,7 +1,21 @@
|
|||
/***************************************************
|
||||
This is a library for the 0.96" 16-bit Color OLED with SSD1331 driver chip
|
||||
|
||||
Pick one up today in the adafruit shop!
|
||||
------> http://www.adafruit.com/products/684
|
||||
|
||||
These displays use SPI to communicate, 4 or 5 pins are required to
|
||||
interface
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
BSD license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
|
||||
#include "Adafruit_SSD1331.h"
|
||||
|
||||
// Graphics library by ladyada/adafruit
|
||||
|
||||
#include "glcdfont.c"
|
||||
#include <avr/pgmspace.h>
|
||||
#include "pins_arduino.h"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,18 @@
|
|||
// Graphics library by ladyada/adafruit
|
||||
// MIT license
|
||||
/***************************************************
|
||||
This is a library for the 0.96" 16-bit Color OLED with SSD1331 driver chip
|
||||
|
||||
Pick one up today in the adafruit shop!
|
||||
------> http://www.adafruit.com/products/684
|
||||
|
||||
These displays use SPI to communicate, 4 or 5 pins are required to
|
||||
interface
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
BSD license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
#define swap(a, b) { uint16_t t = a; a = b; b = t; }
|
||||
|
||||
|
|
|
|||
19
README.txt
Normal file
19
README.txt
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
This is a library for the 0.96" 16-bit Color OLED with SSD1331 driver chip
|
||||
|
||||
Pick one up today in the adafruit shop!
|
||||
------> http://www.adafruit.com/products/684
|
||||
|
||||
These displays use SPI to communicate, 4 or 5 pins are required to
|
||||
interface
|
||||
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
BSD license, check license.txt for more information
|
||||
All text above must be included in any redistribution
|
||||
|
||||
To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_SSD1131. Check that the Adafruit_SSD1331 folder contains Adafruit_SSD1331.cpp and Adafruit_SSD1331.h
|
||||
|
||||
Place the Adafruit_SSD1331 library folder your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.
|
||||
|
|
@ -1,3 +1,21 @@
|
|||
/***************************************************
|
||||
This is a example sketch demonstrating bitmap drawing
|
||||
capabilities of the SSD1331 library for the 0.96"
|
||||
16-bit Color OLED with SSD1331 driver chip
|
||||
|
||||
Pick one up today in the adafruit shop!
|
||||
------> http://www.adafruit.com/products/684
|
||||
|
||||
These displays use SPI to communicate, 4 or 5 pins are required to
|
||||
interface
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
BSD license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
#include <Adafruit_SSD1331.h>
|
||||
#include <SD.h>
|
||||
#include <SPI.h>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,28 @@
|
|||
/***************************************************
|
||||
This is a example sketch demonstrating the graphics
|
||||
capabilities of the SSD1331 library for the 0.96"
|
||||
16-bit Color OLED with SSD1331 driver chip
|
||||
|
||||
Pick one up today in the adafruit shop!
|
||||
------> http://www.adafruit.com/products/684
|
||||
|
||||
These displays use SPI to communicate, 4 or 5 pins are required to
|
||||
interface
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
BSD license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
|
||||
// You can use any (4 or) 5 pins
|
||||
#define sclk 4
|
||||
#define mosi 5
|
||||
#define cs 6
|
||||
#define dc 7
|
||||
#define rst 8 // you can also connect this to the Arduino reset
|
||||
#define sclk 13
|
||||
#define mosi 11
|
||||
#define cs 10
|
||||
#define dc 9
|
||||
#define rst 8
|
||||
|
||||
// Color definitions
|
||||
#define BLACK 0x0000
|
||||
|
|
@ -19,13 +38,13 @@
|
|||
#include <SPI.h>
|
||||
|
||||
// Option 1: use any pins but a little slower
|
||||
// Adafruit_SSD1331 tft = Adafruit_SSD1331(cs, dc, mosi, sclk, rst);
|
||||
Adafruit_SSD1331 tft = Adafruit_SSD1331(cs, dc, mosi, sclk, rst);
|
||||
|
||||
// Option 2: must use the hardware SPI pins
|
||||
// (for UNO thats sclk = 13 and sid = 11) and pin 10 must be
|
||||
// an output. This is much faster - also required if you want
|
||||
// to use the microSD card (see the image drawing example)
|
||||
Adafruit_SSD1331 tft = Adafruit_SSD1331(cs, dc, rst);
|
||||
//Adafruit_SSD1331 tft = Adafruit_SSD1331(cs, dc, rst);
|
||||
|
||||
float p = 3.1415926;
|
||||
|
||||
|
|
|
|||
26
license.txt
Normal file
26
license.txt
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2012, Adafruit Industries
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
Loading…
Reference in a new issue