GC9A01 Frame 2Ah and 2Bh, Not working as expected

Hello,

We have a question about the GC9A01.

We are trying to write 1 pixel to the screen.

The problem is if we change the frame.end.X to x+ 1, and frame.end.Y to y + 1, which means its a 2x2 pixel area on the screen, the pixel does not write on the screen.

Do you have any idea why ? Thanks for the help.

This code works puts 1 pixel on the screen (x,y)

    // Set Frame Command 2Ah , 2Bh
    frame.start.X = x;
    frame.start.Y = y;
    frame.end.X = x;
    frame.end.Y = y;
    GC9A01_set_frame(frame);

    GC9A01_write(p_data,3); // Command 2Ch and then Data

The code below does NOT work, and does not  Only difference is we changed the frame.end.X to x + 1, and frame.end.Y to y + 1;

Can you please tell us what the problem is ?

// Set Frame Command 2Ah , 2Bh
    frame.start.X = x;
    frame.start.Y = y;
    frame.end.X = x+1;
    frame.end.Y = y+1;
    GC9A01_set_frame(frame);

    GC9A01_write(p_data,3); // Command 2Ch and then Data

Thanks

That is not a complete sketch, so it will be difficult for people to help. What library are you using? Google has many examples for a GC9A01, e.g. Using GC9A01 Round LCD Modules | DroneBot Workshop

Try:

x1 = x + 1;
frame.end.X = x1;

This does not work;
x1 = x + 1;
frame.end.X = x1;

I have even tried

frame.start.X = x;
    frame.start.Y = y;
    frame.end.X = x;
    frame.end.Y = y+1;
    GC9A01_set_frame(frame);

And the first couple writes of 3 bytes does not put a pixel on the screen.
The first write of 3 bytes should put one pixel on the screen.

What could be the problem ?

I think "+1" is not in the type of "frame.end.??" and is appended rather than mathematically added. Would you add some debug lines to your code and post the output here? Something like this...

Serial.print("frame.start.X before ");
Serial.println(frame.start.X);
frame.start.X = x;    // original code
Serial.print("frame.start.X after ");
Serial.println(frame.start.X);
Serial.print("x ");
Serial.println(x);

Serial.print("frame.start.Y before ");
Serial.println(frame.start.Y);
frame.start.Y = y;    // original code
Serial.print("frame.start.Y after ");
Serial.println(frame.start.Y);
Serial.print("y ");
Serial.println(y);

Serial.print("frame.end.X before ");
Serial.println(frame.end.X);
frame.end.X = x;    // original code
Serial.print("frame.end.X after ");
Serial.println(frame.end.X);
Serial.print("x ");
Serial.println(x);

Serial.print("frame.end.Y = y + 1 before ");
Serial.println(frame.end.Y);
frame.end.Y = y + 1;    // original code
Serial.print("frame.end.Y = y + 1 after ");
Serial.println(frame.end.Y);
Serial.print("y ");
Serial.println(y);
Serial.print("y+1 ");
Serial.println(y+1);

GC9A01_set_frame(frame);    // original code

Are there anybody ever used Arduino+GC9A01 successes?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.