- #include "ESP32S3VGA.h"
- #include <GfxWrapper.h>
- #include <Fonts/Picopixel.h>
- #include "EspUsbHost.h"
- // r,r,r,r,r, g,g, g, g, g, g, b, b, b, b, b, h,v
- const PinConfig pins(-1,-1,-1,-1,1, -1,-1,-1,-1,-1,2, -1,-1,-1,-1,42, 41,40);
- //VGA Device
- VGA vga;
- Mode mode = Mode::MODE_320x240x60;
- GfxWrapper<VGA> gfx(vga, mode.hRes, mode.vRes);
- class MyEspUsbHost : public EspUsbHost {
- void onKeyboardKey(uint8_t ascii, uint8_t keycode, uint8_t modifier) {
- if (' ' <= ascii && ascii <= '~') {
- gfx.print((char)ascii);
- } else if (ascii == '\r') {
- gfx.println();
- }
- };
- };
- MyEspUsbHost usbHost;
- //initial setup
- void setup()
- {
- Serial.begin(115200);
- vga.bufferCount = 2;
- if(!vga.init(pins, mode, 16)) while(1) delay(1);
- usbHost.begin();
- usbHost.setHIDLocal(HID_LOCAL_Japan_Katakana);
- vga.start();
- gfx.setCursor(0, 10);
- vga.clear(vga.rgb(0, 0, 0));
- gfx.setFont(&Picopixel);
- }
- //the loop is done every frame
- void loop()
- {
- usbHost.task();
- vga.show();
- }
I'm trying to display characters to a screen with a keyboard using "ESP32S3VGA" and "EspUsbHost",
but when I write more than 5/6 characters the screen just loses signal and it just says "no signal", like it doesn't even send a signal after this character limit,
The VGA RGB are connected to GPIO 1, 2 and 42, The Hsync is 41 and the Vsync is 40.
The Keyboard is connected to the pins 20 and 19 (The USB+ and USB- of the board).
I'm using an ESP32 S3 WROOM 1 with OPI PSRAM.
Could someone figure this out?
Thanks.