LCD "Draw" commands

It appears that none of the LCD “draw” commands work. I’ve tried drawRect(), drawLine(), etc., but all I get is a blank screen (with some “garbage” pixels to the left of the screen). Can anyone confirm?

I’m using the examples found here:

arcbotics.com/products/sparki/parts/lcd/

Unfortunately, there are no example LCD sketches included with my (Mac) version of Sparkiduino. Am I missing an initialization that’s not documented or something?

TIA,

Paul

It appears that the same is true for the Windows version of Sparkiduino. The LCD examples are non-existent. Simple “println” stuff to the LCD works okay, but pixel-based functions are a no-go…

I think maybe the LCD implementation is unfinished?

Any updates from Arcbotics on this? The fact that readPixel() compiles but drawPixel() doesn’t compile suggests that these LCD functions are in an incomplete state, but it’s hard to know for sure without confirmation from Arcbotics.

I’m working on a project, but I can’t complete it yet since it requires a few of these capabilities…

TIA,

Paul

Yeah. Same issue. A bit of a holdup with a project. Really need to draw pixel by pixel on the screen and the compiler doesn’t recognize sparki.drawPixel
Tried some combos’ of caps, no luck.

This is curious. I’ll take a look. If its a software issue, there should be an update in a couple of days.

I’ve found out the way to work around the LCD commands

It seems drawPixel has a third parameter which is the color, in this case there is no color, 0 means dark, any other number means lighten up.

In my case I only wanted to draw circles so I just copied the code from https://github.com/ArcBotics/Sparki/blob/master/Arduino%20Library/Sparki.cpp drawCircle into my sketch and modified the WHITE to 1. And it works perfectly.

Hope it helps.

The “Parts” tutorial says "ArcBotics Arduino already has code examples for you to use: File > Examples > LCD

I cannot find this in the Sparkiduino IDE. Do I have an old version of the installation? Where can I pick up this example code?

@jordi:

I’ve tried adding a third parameter to drawPixel and it compiles, but it doesn’t work. On loading to Sparki, I just get the Sparki logo screen. So unfortunately, this didn’t work for me.

Hopefully, the next update will address these issues. Anyway, thanks for the tip!

I’m also having issues with my LCD screen. There seems to be junk pixels along the left side of the screen, regardless of what’s being drawn.

I do hope that’s a software issue as I’d hate to have to send my Sparki back for repairs.

[quote=“distantcam”]I’m also having issues with my LCD screen. There seems to be junk pixels along the left side of the screen, regardless of what’s being drawn.

I do hope that’s a software issue as I’d hate to have to send my Sparki back for repairs.[/quote]

My screen has similar issues with lines, I think it’s probably software.

Just ran this dodgy bit of code to see if the sparki.drawPixel command would work with the (x, y,1) syntax. And it does map stuff OK, so it seems that syntax is good to go!
/*******************************************
Sonar display

********************************************/
#include <Sparki.h>
int k;
void setup()
{
sparki.clearLCD();
}

void loop()
{

sparki.clearLCD();
for (k = -60;k<60;k++) //sweep angle left to right
{
sparki.servo(k);
delay(300);
int cm = sparki.ping(); // dist measure

sparki.drawPixel(k+60, cm,1);  //plot using angle on x axis, cm dist scale direct to y axis
 sparki.updateLCD(); 

}
for (k = 60; k>-60;k–) //scan back
{
sparki.servo(k);
delay(300);
int cm = sparki.ping();

sparki.drawPixel(k+60, cm,1);
sparki.updateLCD();
}
}

fyi, the latest update will break these fixes, but the code works as advertised now

Since this is likely to happen quite a bit in the near future, it might be a good idea for everyone to post their Sparkiduino version number when posting code/code snippets to the forums from now on. This may avoid some confusion when someone tries to run older code that no longer works on the newest Sparkiduino release.

What do you guys think?

Since this is likely to happen quite a bit in the near future, it might be a good idea for everyone to post their Sparkiduino version number when posting code/code snippets to the forums from now on. This may avoid some confusion when someone tries to run older code that no longer works on the newest Sparkiduino release.

What do you guys think?[/quote]
I certainly agree that the total environment (SparkiDuino/library file name; dates for Sparki.h and Sparki.cpp; and OS version) needs to be given for both code submission and problem reporting.

The code developer should also note any feature they hard coded around (adding an offset to a returned function value) to make what they did work.

Example:
Sparki Library used: Sparki.Driver-1.0.5.4a-Setup.exe or Sparki_Library_1.0.5.4.zip
Sparki.h modified date: 20140217 @ 09:20
Sparki.cpp modified date: 20140217 @ 09:23
Computer OS: Windows 7 / 8.1
Notes:

Thank’s. It’s amazing!

[code]/*******************************************

void setup(){
}

// define little image of Sparki
// sets up the special variable type needed for images
// La imagen esta convertida a ensamblador con BMP2ASM para win, esta en descargas
static unsigned char attribute ((progmem)) sparki_image[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xE0,0xF0,0xF8,0xF8,0xF8,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xF8,0xF8,0xF0,0xE0,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x20,0x30,0x18,0x88,0xEC,0x3E,0xFE,0xC0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCF,0x07,0x03,0x03,0x01,0x03,0x03,0x07,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x70,0x18,0x0F,0x03,0x00,0x00,0x01,0x07,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x1F,0x3F,0x7F,0x7F,0xFF,0xFF,0xFE,0xFE,0xFC,0xFC,0xFC,0xFE,0xFF,0xFF,0xFF,0x7F,0x7F,0x1F,0x1F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x60,0x70,0x18,0x18,0x0E,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x81,0x81,0x81,0x81,0x81,0x80,0xC0,0xC0,0xC0,0x40,0x60,0x60,0x30,0x10,0x18,0x18,0x0C,0x0C,0x06,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x40,0x60,0x20,0x30,0x18,0x18,0x08,0x0C,0x04,0x06,0x06,0x06,0x02,0x03,0x03,0x03,0x03,0x01,0x81,0x81,0x81,0x81,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x60,0x30,0x18,0x0C,0x06,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xF0,0x18,0x0C,0x06,0x06,0x03,0x83,0xC1,0xC1,0xC1,0xC3,0xC3,0x83,0x03,0x06,0x0E,0x1C,0x38,0xF0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x98,0xCC,0xFC,0x3E,0x7F,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xC0,0x00,0x00,0x00,0x0C,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x3F,0x0C,0x00,0x00,0x80,0xE1,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x04,0x06,0x42,0xF3,0x3B,0x0F,0x07,0x3C,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0x0C,0x18,0x38,0x30,0x30,0x30,0x70,0x70,0x70,0x70,0x30,0x38,0x18,0x0C,0x0E,0x07,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x02,0x02,0x02,0x00,0x00,0x3F,0x01,0x01,0x00,0x00,0x1F,0x20,0x20,0x20,0x3F,0x00,0x00,};

void loop()
{
sparki.clearLCD(); // wipe the LCD clear
sparki.drawBitmap(18, 0, sparki_image, 90, 64);
sparki.updateLCD(); // put the drawings on the screen
delay(1000);
}[/code]