drawPixel Rarely Working

Post Reply
Bilboed
Posts: 17
Joined: Sun Apr 14, 2013 8:36 pm
languages_spoken: english
ODROIDs: U2, U3 and Show
Has thanked: 0
Been thanked: 0
Contact:

drawPixel Rarely Working

Post by Bilboed »

I am trying to update specific pixels on the show but it is not working.
"drawPixel" is used in show_main.ino (i.e. E[10:10X ) to update the pixel colour but it very rarely works. Perhaps 1 in a hundred times, no matter how long I sleep between each call.
The serial bus returns the text with the row and col, thus the formatting was correct.

I then updated the main loop in the ino file to draw a series of pixels and it also rarely works. The problem seems to be that drawPixel library function is not working.

Any help would be appreciated

User avatar
odroid
Site Admin
Posts: 34876
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 942 times
Been thanked: 762 times
Contact:

Re: drawPixel Rarely Working

Post by odroid »

Can you share your host side source code? We will test it.

hokoon
Posts: 262
Joined: Tue Jun 11, 2013 2:55 pm
languages_spoken: ไทย
ODROIDs: U2, XU, U3, C-1
Has thanked: 0
Been thanked: 1 time
Contact:

Re: drawPixel Rarely Working

Post by hokoon »

odroid wrote:Can you share your host side source code? We will test it.
I confirm the issue.

Code modify from show_main.ino

Code: Select all

void setup()
{
    Serial.begin(500000);
    Serial.println("Welcome to the ODROID-SHOW");

    tft.begin();
    initPins();

    tft.fillScreen(backgroundColor);

    tft.drawPixel(100, 100, foregroundColor); // It just skip this line

    
    Timer1.initialize(20000);
    Timer1.attachInterrupt(timerCallback);
}

hokoon
Posts: 262
Joined: Tue Jun 11, 2013 2:55 pm
languages_spoken: ไทย
ODROIDs: U2, XU, U3, C-1
Has thanked: 0
Been thanked: 1 time
Contact:

Re: drawPixel Rarely Working

Post by hokoon »

This is what I get when I try to draw a mandelbrot from Magazine (August 2014)
https://github.com/declanmalone/ODROID- ... ndelbrot.c

Image

User avatar
odroid
Site Admin
Posts: 34876
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 942 times
Been thanked: 762 times
Contact:

Re: drawPixel Rarely Working

Post by odroid »

Can you lower the SPI clock speed to narrow down the root causes?
It will be helpful to confirm whether the Adafruit Gfx library has an issue or not.

Anyway, we will try the example code you pointed.

lsc1117
Posts: 185
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Has thanked: 0
Been thanked: 15 times
Contact:

Re: drawPixel Rarely Working

Post by lsc1117 »

Hi,

I tried to run the mandelbrot example a hundred times. and It is working well.
test.jpg
test.jpg (264.48 KiB) Viewed 2790 times
Did you upload the Declanmalone's .ino file?

You should upload the Declanmalone's f/w before running the example.

hokoon
Posts: 262
Joined: Tue Jun 11, 2013 2:55 pm
languages_spoken: ไทย
ODROIDs: U2, XU, U3, C-1
Has thanked: 0
Been thanked: 1 time
Contact:

Re: drawPixel Rarely Working

Post by hokoon »

I manage to solve the problem by replace drawPixel with fillRect

Image

btw, I'm using lastest show_main.ino from HK repo (https://github.com/hardkernel/ODROID-SHOW)

Post Reply

Return to “SHOW”

Who is online

Users browsing this forum: No registered users and 1 guest