Hi everyone.
I've just started with the arduino and therefore am ignorant of much of it, so please be gentle
I'm trying to build a project where an arduino will use a rotary encoder (read thru interrupt) to move thru a menu on a 128x64 LCD, read a barcode thru barcode reader, send the barcode thru an APC220, save the barcode to the uSD card if the APC220 is out of range (no reply from the other APC220 connected to another arduino with an ethernet shield that will receive barcode from several clients and send it thru ethernet to a database) and when it gets back in range (sucefully sends a barcode) sends the saved barcodes and deletes them from the uSD.
On the interface shield I have the LCD connected to the shiftout, the APC220 on the APC&BT pins and a uSD card inside the uSD card slot.
If I only have the LCD, I can send full screen images and text with no issues to the LCD, however, as soon as I add an #include <SD.h> the serial.print commands stop working.
Any ideas on how to connect everything so that it all works?
I also use the DFRobot.com Interface shield V1.1 and the SPI LCD 12464.
ARDUINO UNO on USB ( power )
The LCD works fine in textmode ( 4 lines) with DFRobot lib.
for graphic i did not find a library.
as its uses the shiftoutcable D3, D8, D9 (5V, GND) it is NOT SPI ( as its called )
The uSD card ( example KINGSTON 4GB ) works fine with ARDUINO SD library. as a SPI device.
Without resistors (compare original arduino ethernetshield sd card wiring ) using SS, MOSI,SCK,MISO (5V arduino outputs but 3V3 for sd card power).
There is no conflict in wiring or in libraries, but they fail to work
together most time. ( sometimes the LCD works but dimms at SD card write cycle, sometimes the SD init dont work.... )
I assume it is a power problem, even i not write to SD and LCD at same second.
Anyhow there is no RTC, so a SD card datalogger ( using millis info ) is of limited use.
see adafruit datalogger with RTC, power, SDcard...
The LCD works fine in textmode ( 4 lines) with DFRobot lib.
for graphic i did not find a library.
as its uses the shiftoutcable D3, D8, D9 (5V, GND) it is NOT SPI ( as its called )
I've had no issues getting a image to appear on the LCD.
I'm using the LCD12864RSPI library and the code below.
Beware that I didn't try to run this code, it's just a quick copy/paste made in notepad of part of my sketch.
What I was trying to do is modify the library to use flash instead of RAM to store the image.
Another possible way to change it is to try and use some algorithm (RLE?) to compress the image further so that it takes up less space in memory and/or Flash.
#include <LCD12864RSPI.h>
#include "BootLogo_bmp.h"
void setup() // run once, when the sketch starts
{
LCDA.Initialise(); // INIT SCREEN
delay(100);
LCDA.DrawFullScreen(&logo);//LOGO
delay(3000);
LCDA.CLEAR();
delay(10);
}
void loop() // run over and over again
{
}
/* -------------------------------------
* DFRobot.com LCD12864 plugged into SPI
* (shiftout) of DFRobot Interface Shield
* PIN1 = GND
* PIN2 = VCC 5V
* D8 = RS(CS) = 8 (latchPin);
* D9 = RW(SID)= 9 (dataPin);
* D3 = EN(CLK) = 3 (clockPin);
/* -------------------------------------
The uSD card ( example KINGSTON 4GB ) works fine with ARDUINO SD library. as a SPI device.
Without resistors (compare original arduino ethernetshield sd card wiring ) using SS, MOSI,SCK,MISO (5V arduino outputs but 3V3 for sd card power).
There is no conflict in wiring or in libraries, but they fail to work
together most time. ( sometimes the LCD works but dimms at SD card write cycle, sometimes the SD init dont work.... )
I assume it is a power problem, even i not write to SD and LCD at same second.
I can tell you that my uSD card also doesn't work, but I always assumed it was a mechanical malfunction since the soldering job on the uSD connector is terrible.
Also, I'm not sure there's enough memory SRAM to use the SD and LCD libraries at the same time.
sorry, yes the DrawFullScreen function of DFRobot SPI LCD lib works too.
but i not see that as a graphic lib.
you can change pix in "logo" and reload, that works.
for RAM FLASH i have same question,
i wanted to test
for uSD card:
my DFRobot interface shield V1.1
was ready, nothing to solder.
but i did not use the DFRobot lib, i used the ARDUINO lib and it worked directly.
( LCD not connected, LCD lib not included )
SRAM? running both libs
ARDUINO SD and DFRobot LCD12864RSPI and load logo file...
actually was no RAM problem for ARDUINO UNO.
( but as indicated it looked like POWER problems. )
for the LOGO i needed to make a new library function
where the FLASH LOGO is directly loaded to LCD
( note FLASH variables can not be modified / written to )
// lib
#include <avr/pgmspace.h>
// variable declaration:
     prog_uchar PROGMEM enchar0[] = {"my text of 16 ch"};   // in flash
     unsigned char mline1[]="         ";        // in ram
// readback variable to RAM:
for (int i=0; i<=15; i++) { mline1[i] = pgm_read_byte(&enchar0[i]); }
// variable declaration LOGO:
prog_uchar PROGMEM logo[]={ Â Â // FLASH
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,......
// write to LCD
 LCDA.DrawFullScreen_FLASH(logo);                 //FLASH LOGO by FLASH DRAW
 delay(2000);
pls see att zip of my flash version of SPI LCD MENU