Giter Club home page Giter Club logo

gd23z's People

Contributors

lightcalamar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gd23z's Issues

Cannot load jpeg on Uno+Riverdi 7"

Hi,
When I try to load jpg file I only get the red screen.
I'm using UNO+Riverdi_arduino_tft board+Riverdi 7" FT813 touch screen

My code is:


void setup()
{
  Serial.begin(9600);
  GD.begin();
  //GD.self_calibrate();
  GD.cmd_loadimage(0,0);
  GD.load("sunrise.jpg");
}

void loop()
{
  GD.Clear();
  GD.Begin(BITMAPS);
  GD.BitmapSize(NEAREST, BORDER, BORDER, 64, 64);
  GD.Vertex2ii(0, 0);
  GD.swap();
}

I've enabled debug mode and in serial terminal I can see this:

Sending card init command
1
1
0
OK
OCR=2164228096 80FF8000
OCR=2164228096 80FF8000
OCR=2164228096 80FF8000
OCR=2164228096 80FF8000
OCR=2164228096 80FF8000
OCR=2164228096 80FF8000
OCR=2164228096 80FF8000
OCR=2164228096 80FF8000
OCR=2164228096 80FF8000
OCR=2164228096 80FF8000
ccs=0 0
type_code=11 B
sectors_per_cluster=32 20
finished

My SD card is fat16. I've tried with both fat16 and fat32 enabled in GD23Z.h file.
I can display buttons, shapes, progress bars without any problems, but whenever I try to display jpg I get red screen.
What could be the reason?

EEPROM emulation

STM32 has EEPROM emulation.
So i change this code

[Current]
#if defined(ARDUINO_ARCH_STM32)
//FT81XMANIA TEAM (@lightcalamar)
///////////////////////////////////////////////////////////////////////////////////////////////////////

AT24Cxx eep(i2c_address, 32);
if (eep.read(0) != 0x7c) {
self_calibrate();
for (int i = 0; i < 24; i++)
eep.write(1 + i, GDTR.rd(REG_TOUCH_TRANSFORM_A + i));
eep.write(0, 0x7c); // is written!
} else {
for (int i = 0; i < 24; i++)
GDTR.wr(REG_TOUCH_TRANSFORM_A + i, eep.read(1 + i));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////
//FT81XMANIA TEAM (@lightcalamar)
#endif

[Edit]
#if defined(__STM32F1__)
uint16 Status;
uint16_t Data;
Status = EEPROM.read(0x10,&Data);
Serial.print("Data.EEPROM[10]=");
Serial.println(Data,HEX);
if (Data != 0x7c) {
self_calibrate();
for (int i = 0; i < 24; i++) {
Data = GDTR.rd(REG_TOUCH_TRANSFORM_A + i);
Serial.print("Data.rd[" + String(i) + "=");
Serial.println(Data, HEX);
EEPROM.write(0x20 + i, Data);
}
EEPROM.write(0x10, 0x7c); // is written!
} else {
for (int i = 0; i < 24; i++) {
Status=EEPROM.read(0x20+i,&Data);
Serial.print("Data.EEPROM[=" + String(i) + "]=");
Serial.println(Data,HEX);
GDTR.wr(REG_TOUCH_TRANSFORM_A + i, Data);
}
}
#endif

defined(ARDUINO_ARCH_STM32)

Thank you for your great work.
This define is not valid for Arduino_STM32 core.

https://github.com/rogerclarkmelbourne/Arduino_STM32

Check this code using Arduino_STM32 core.

#if defined(ARDUINO_ARCH_STM32)
#define MODEL "ARDUINO_ARCH_STM32"
#elif defined(STM32)
#define MODEL "STM32"
#else
#define MODEL "NONE"
#endif
void setup() {
delay(1000);
Serial.begin(9600);
Serial.println(MODEL);
}
void loop() {
// put your main code here, to run repeatedly:
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.