ginge / libdgus_ii

DWIN DGUS II interface library
MIT License
12 stars 8 forks source link

Need help for Arduino #1

Open manjeetparjapati opened 3 years ago

manjeetparjapati commented 3 years ago

Hi Thanks for lib, I really appreciate it. I want to use this lib in my Arduino Code. I have been working on that for last three days but no success. Please help me out

Code:

include

include

include

include

include

include

include

include "dgus.h"

include "dgus_lcd.c"

include "dgus_util.c"

define BAUD 115200

void _a_recv_handler(char data, uint8_t cmd, uint8_t len, uint16_t addr, uint8_t bytelen) { if (addr == 0x1002 && (uint16_t)(uint16_t *)data == 0x03) { dgus_set_page(12); } }

uint8_t _serial_bytes_available() { return Serial1.available(); }

char _serial_recv_byte() { char c; c=Serial1.read(); return c; }

void _serial_send_data(char *data, size_t len) { Serial1.write(data,len); }

void setup() { Serial1.begin(BAUD);

dgus_init(_serial_bytes_available, _serial_recv_byte, _serial_send_data, _a_recv_handler); dgus_set_page(10); }

void loop() { }

Code finish here:

I am using VS code (Platformio). After Build above code, received an error. collect2.exe: error: ld returned 1 exit status

some error also showed up like dgus_lcd.c:206:36: error: invalid conversion from 'uint8_t' {aka 'unsigned char'} to 'char*' [-fpermissive] but I resolved it by changing uint8_t to char

Waiting for your reply Again thanks for library code.

ginge commented 3 years ago

Can you provide more information of what isn't working please?

manjeetparjapati commented 3 years ago

I have found problem, Its not in your code. let me explain for others. I am using Visual Studio Code and PlatformIO. I was using ST STM32 Platform and Bluepill F103C8 Board, In which code is giving me error [collect2.exe: error: ld returned 1 exit status]. I dont know the reason, after searching on Goggle I found lots of people having this error for different-different reasons in ST STM32 Platform. So I changed my board to ESP32 board (Platform- Espressif 32) and create a new project and then code working alright (some data type error came but I fixed it like uint_8 to char , size_t to short and calloc(1,sz) is void type )

Thanks for Library if possible could you please add some more features like Draw(Line rect, circle ), Scrolling, Buttons Interrupts functions etc Have a nice day

mfatihkc commented 3 years ago

Hello I am using also platformIO. Can you @manjeetparjapati explain to me How add this library to my project please?

mfatihkc commented 3 years ago

When I am gonna build, I took this error image

mfatihkc commented 3 years ago

if I am gonna use library just dgus.h

include

include

include

include

include

include

include

include "libdgus_ii-master/dgus.h"

/*

define RXD2 16

define TXD2 17

void _a_recv_handler(char *data, uint8_t cmd, uint8_t len, uint16_t addr, uint8_t bytelen) { dgus_set_page(12); }

uint8_t _serial_bytes_available() { return Serial2.available(); }

char _serial_recv_byte() { char c; c=Serial2.read(); return c; }

void _serial_send_data(char *data, size_t len) { Serial2.write(data,len); }

void setup() { // Note the format for setting a serial port is as follows: Serial2.begin(baud-rate, protocol, RX pin, TX pin); Serial.begin(115200); //Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2); Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2,true); Serial.println("Serial Txd is on pin: "+String(TX)); Serial.println("Serial Rxd is on pin: "+String(RX));

dgus_init(_serial_bytes_available, _serial_recv_byte, _serial_send_data, _a_recv_handler);

}

void loop() { //Choose Serial2 or Serial2 as required

}

image

manjeetparjapati commented 3 years ago

Code:

include

include

include

include

include

include

include

include "dgus.h"

include "dgus_lcd.c"

include "dgus_util.c"

define BAUD 115200

void _a_recv_handler(char data, uint8_t cmd, uint8_t len, uint16_t addr, uint8_t bytelen) { if (addr == 0x1002 && (uint16_t)(uint16_t *)data == 0x03) { dgus_set_page(12); } }

uint8_t _serial_bytes_available() { return Serial1.available(); }

char _serial_recv_byte() { char c; c=Serial1.read(); return c; }

void _serial_send_data(char *data, size_t len) { Serial1.write(data,len); }

void setup() { Serial1.begin(BAUD);

dgus_init(_serial_bytes_available, _serial_recv_byte, _serial_send_data, _a_recv_handler); dgus_set_page(10); }

void loop() { }

Code finish here:

(some data type error came but I fixed it like uint_8 to char , size_t to short and calloc(1,sz) is void type )

If problem doesn't solve , let me know. I will send you working project (PlatformIO ESP32.)

mfatihkc commented 3 years ago

Yes I have a got error this line code. When I do copy paste.

Maybe I made a mistake about inclue library. becaue I did just copy paste under include folder and I gave like this

include "libdgus_ii-master/dgus.h"

include "libdgus_ii-master/dgus_lcd.c"

include "libdgus_ii-master/dgus_util.c"

image

mfatihkc commented 3 years ago

Can you send me your working project please? @manjeetparjapati

jendakol commented 2 years ago

@manjeetparjapati @mfatihkc Hi guys, has any of you succeeded with this? I'm going to try DWIN display with ESP32 (Platformio) so it would be nice to know if anyone before me has actually made success 😃

wramadhani70 commented 2 years ago

Hi master, i need help how to use this library's correctly?

jendakol commented 2 years ago

@wramadhani70 For the record, I ended up writing the DWIN display manipulation library by myself ;-) I'm more than happy to share the code with you, if you want. I used it for DMG80480C070_04WTC.

wramadhani70 commented 2 years ago

Hi master, I will gladly accept it if you are willing to share the source code of using this library, it also makes me feel very helpful for learn this library and display,

jendakol commented 2 years ago

@wramadhani70 It's not this library I used, I wrote my own. The code is here: https://github.com/litvinov-tabor2022/kiosk/tree/main/src/hw

wramadhani70 commented 2 years ago

Thank you so much Master, i will try it Master @jendakol,

avrhama commented 2 years ago

HI, thanks for lib!. question: is it possible to draw an array of pixels(with different colors)? my task is to draw a dynamic image to the DWIN display.