Giter VIP home page Giter VIP logo

adafruit-rgb-lcd-shield-library's Introduction

Adafruit RGB LCD Shield Library Build StatusDocumentation

This is a library for the Adafruit RGB 16x2 LCD Shield

Pick one up at the Adafruit shop! ---------> https://www.adafruit.com/products/714

This new Adafruit shield makes it easy to use a 16x2 Character LCD. We really like the range of LCDs we stock in the shop, such as our classic blue & white as well as the fancy RGB negative and RGB positive. Unfortunately, these LCDs do require quite a few digital pins, 6 to control the LCD and then perhaps another 3 to control the RGB backlight for a total of 9 pins. That's half of the pins available on a classic Arduino!

With this in mind, we wanted to make it easier for people to get these LCD into their projects so we devised a shield that lets you control a 16x2 Character LCD, up to 3 backlight pins AND 5 keypad pins using only the two I2C pins on the Arduino! The best part is you don't really lose those two pins either, since you can stick i2c-based sensors, RTCs, etc and have them share the I2C bus. This is a super slick way to add a display without all the wiring hassle.


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_RGBLCDShield. Check that the Adafruit_RGBLCDShield folder contains Adafruit_RGBLCDShield.cpp and Adafruit_RGBLCDShield.h

Place the Adafruit_RGBLCDShield library folder your /libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.

adafruit-rgb-lcd-shield-library's People

Contributors

bjsco avatar driverblock avatar evaherrada avatar ladyada avatar n-gineer avatar paintyourdragon avatar simonmeusel avatar tdicola avatar tyeth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit-rgb-lcd-shield-library's Issues

arduino due + Adafruit-RGB-LCD-Shield-Library not display the program hello world with SDA (20) and SCL(21)

Hello,

I'm trying to display the program Hello world https://github.com/adafruit/Adafruit-RGB-LCD-Shield-Library/blob/master/examples/HelloWorld/HelloWorld.ino with the Adafruit-RGB-LCD-Shield https://www.adafruit.com/product/714 with the SDA (20) and the SCL (21) but is not working.

The shield is correctly powered. I think that the issue is in the following code:
https://github.com/adafruit/Adafruit-RGB-LCD-Shield-Library/blob/master/Adafruit_RGBLCDShield.cpp

`
#include "Adafruit_RGBLCDShield.h"

#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <Wire.h>
#ifdef SAM3X8E // Arduino Due
#define WIRE Wire1
#else
#define WIRE Wire
#endif

#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
`
When the code define Wire Wire1 for the arduino Due, therefore the pins SDA (20) and SCL (21) cannot be used. Only the pins SCL1 and SDA1.
While I would like to use the pins SCL1 and SDA1 and SDA (20) and SCL (21).

Can you change the line #define WIRE Wire1 to use the four pins ?

Thanks for the help .

Port to particle.io

Ada-peeps,
What's the chances of getting this ported to Particle (formerly spark)? I gave it a shot, but kind of failed :(

Thanks,
James

Buttons are not thoroughly debounced

Hi,
recently bought the RGB LCD Shield Kit (http://www.adafruit.com/products/714).

It seems that Buttons are not completely debounced. The tutorial (http://learn.adafruit.com/rgb-lcd-shield/using-the-rgb-lcd-shield) states otherwise: "Note that the library handles button debouncing internally. There is no need to debounce the buttons in your code.".

See this gist with a sample program, to see how a value jumps due to bouncing buttons:
https://gist.github.com/osune/8026836

Thanks.

Library won't compile on Uno Wifi Rev 2

  • Arduino board: Uno Wifi Rev 2

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.13

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too):
    Open Example sketch "Hello World", select board: uno Wifi Rev 2, Verify Sketch

In trying to simply compile the Adafruit RGB LCD Shield "Hello World" example, I am getting this error:

Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "Arduino Uno WiFi Rev2, ATMEGA328"

In file included from C:\Users\...\Arduino\libraries\Adafruit_RGB_LCD_Shield_Library\Adafruit_RGBLCDShield.cpp:17:0:

C:\Users\...\Arduino\libraries\Adafruit_RGB_LCD_Shield_Library\Adafruit_RGBLCDShield.h:68:44: error: expected class-name before '{' token

 class Adafruit_RGBLCDShield : public Print {

                                            ^

exit status 1
Error compiling for board Arduino Uno WiFi Rev2.

I think I found some clue to the problem:

Because the uno wifi R2 is a megaavr board and not an avr board, I went looking for the source code for Print.h. These apparently are not in the same location. From what I could find, there are at least two versions. I could not find the avr file (C:\Users...\ArduinoData\packages\arduino\hardware\avr folder is blank)

However, the megaavr folder was not. I did find Print.h in:
(C:\Users...\ArduinoData\packages\arduino\hardware\megaavr\1.8.6\cores\arduino\api)

While there, I noticed it defined the "Print" class within the "arduino" namespace.

namespace arduino {

class Print
{

I thought maybe there's another Print.h in a different namespace that is conflicting.

So, I edited the RGB LCD Shield header file to say:
class Adafruit_RGBLCDShield : public arduino::Print {
and it compiles for the Uno Wifi Rev 2. However, the arduino namespace appears to not be known to the avr boards, and now won't compile for them, even if I use
using namespace arduino
in the RGB_LCD header file.

I also checked and this behavior also happens with the liquid crystal library, upon which this is based, so maybe it's their issue to resolve?

Unable to use this with my other MCP IO expander chip (using adafruit libraries)

My code is as follows:
`// Connect pin #12 of the expander to Analog 5 (i2c clock)
// Connect pin #13 of the expander to Analog 4 (i2c data)
// Connect pins #15, 16 and 17 of the expander to 3V3 (address selection)
// Connect pin #9 of the expander to 5V (power)
// Connect pin #10 of the expander to ground (common ground)
// Connect pin #18 through a ~10kohm resistor to 5V (reset pin, active low)

// Input #0 is on pin 21 so connect a button or switch from there to ground

// include the library code:
#include <Wire.h>
#include <Adafruit_RGBLCDShield.h>
#include <utility/Adafruit_MCP23017.h>
//#include "Adafruit_MCP23017.h"

// The shield uses the I2C SCL and SDA pins. On classic Arduinos
// this is Analog 4 and 5 so you can't use those for analogRead() anymore
// However, you can connect other I2C sensors to the I2C bus and share
// the I2C bus.
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
Adafruit_MCP23017 mcp;

// These #defines make it easy to set the backlight color
#define RED 0x1
#define YELLOW 0x3
#define GREEN 0x2
#define TEAL 0x6
#define BLUE 0x4
#define VIOLET 0x5
#define WHITE 0x7
#define addr1 7 // 7 = A1 high, A2 high, A3 high

void setup() {
// Debugging output
Serial.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
mcp.begin(addr1);
mcp.pinMode(0, INPUT);
mcp.pullUp(0, HIGH); // turn on a 100K pullup internally

pinMode(13, OUTPUT); // use the p13 LED as debugging

// Print a message to the LCD. We track how long it takes since
// this library has been optimized a bit and we're proud of it :)
int time = millis();
lcd.print("Hello, world!");
time = millis() - time;
Serial.print("Took "); Serial.print(time); Serial.println(" ms");
lcd.setBacklight(RED);
}

uint8_t i=0;
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);

uint8_t buttons = lcd.readButtons();

if (buttons) {
lcd.clear();
lcd.setCursor(0,0);
if (buttons & BUTTON_UP) {
lcd.print("UP ");
}
if (buttons & BUTTON_DOWN) {
lcd.print("DOWN ");
}
if (buttons & BUTTON_LEFT) {
lcd.print("LEFT ");
}
if (buttons & BUTTON_RIGHT) {
lcd.print("RIGHT ");
}
if (buttons & BUTTON_SELECT) {
lcd.print("SELECT ");
}
}
digitalWrite(13, mcp.digitalRead(0));
}`

for some reson the hat is working but the other MCP23017 chip

This seems to be newer https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library

Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:

  • Do not use GitHub issues for troubleshooting projects and issues. Instead use
    the forums at http://forums.adafruit.com to ask questions and troubleshoot why
    something isn't working as expected. In many cases the problem is a common issue
    that you will more quickly receive help from the forum community. GitHub issues
    are meant for known defects in the code. If you don't know if there is a defect
    in the code then start with troubleshooting on the forum first.

  • If following a tutorial or guide be sure you didn't miss a step. Carefully
    check all of the steps and commands to run have been followed. Consult the
    forum if you're unsure or have questions about steps in a guide/tutorial.

  • For Arduino projects check these very common issues to ensure they don't apply:

    • For uploading sketches or communicating with the board make sure you're using
      a USB data cable and not a USB charge-only cable. It is sometimes
      very hard to tell the difference between a data and charge cable! Try using the
      cable with other devices or swapping to another cable to confirm it is not
      the problem.

    • Be sure you are supplying adequate power to the board. Check the specs of
      your board and plug in an external power supply. In many cases just
      plugging a board into your computer is not enough to power it and other
      peripherals.

    • Double check all soldering joints and connections. Flakey connections
      cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.

    • Ensure you are using an official Arduino or Adafruit board. We can't
      guarantee a clone board will have the same functionality and work as expected
      with this code and don't support them.

If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:

  • Arduino board: INSERT ARDUINO BOARD NAME/TYPE HERE

  • Arduino IDE version (found in Arduino -> About Arduino menu): INSERT ARDUINO
    VERSION HERE

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): LIST REPRO STEPS BELOW

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.