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
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