Many thanks to you
@klaus and even
@stevel05, I admit that hearing these words of yours gives me a lot of joy, especially at the gates of Easter, you have always been true Gurus of B4X and I admire you very much for the great contribution you have given that more, you add new things that you have built together with
@Erel to create a great and powerful development system. I remember that more than 10 years ago, when I was ready to use B4X the first times (with B4A), you were already doing things that were unreachable for me, and you had already helped many people to appreciate B4X. But now I studied and always used all B4X products (except B4i) so now I developed some things I had in mind for years but very difficult to me in past.
On this direction I recently contributed to B4X with my WebGL library and other small libraries.
Since I saw you both curious about the work I am doing with B4X and ESP8266/ESP32/RP2040/Arduino microcontrollers, and since the VirtualDisplay library written in C++ for Arduino environment will be completely opensource on github next, and also the VirtualDisplay desktop app developed with B4J (not the code but the compiled app) will be free, I decided that I will post here the header file .h of my library so that you can understand what I am trying to do and see all the library commands the library have to iteract with B4X side over network.
Don't be offended
@Erel if I post a file not related to B4X but to C++, in that case just let me know and I'll remove it, in any case the library will be available later on github.
If someone is interested (but have knowledge) to convert this library to B4R I can send the full library .h and .cpp files.
My intent, once again at this point, is to make you understand what I'm trying to do, and maybe some of you can give me advice and ideas, I'm always available to evaluate any ideas.
Note that I want release next the VirtuaDisplay Arduino library opensource, but I want to sell on Google Play Store in future the Android counterpart of desktop VirtualDisplay app, it is already developed and working. On C++ side the same codes (sketchs) compiles for now on ESP8266 and ESP32 (in a transparent way) without any modification at all. The library come with approximately 30 demos.
Initially I started to make it possible to have a sort of remote display over wifi on the microcontroller side, then when everything worked well and implemented all the B4X B4XCanvas commands on microcontroller side, to work like all hardware TFT libraries (but remotely), after several months, I started to add particular commands in order to make the microcontroller interact with B4X. In this sense for example the micro can not only use the Canvas, but can do other useful things, such as drawing buttons, sliders, meterbars, leds and more all with feedback, so if the micro will draw eg. 10 buttons, each have it's index, when the user press a button, the micro know what button is pressed by it's index, eg. button[index].value will be 0 or 1. the same things for other controllers like sliders, eg.the micro can draw 10 sliders (customized) and when the user move some sliders, the micro know what slider is moved and it's value. The library for now support max 64 controllers of each type.
After this, on Android, the micro can read all sensors, eg. the accelerometer, gyroscope, e much more, even the GPS, even the battery state.
The micro can use these sensors the same way that have real hardware sensors attached to it, but even works over wifi, non only local, even over internet.
So eg, ESP32 can draw on a remote phone or tablet or PC, in local network or over internet, before of all it know the sceen size of remote device, then can draw everything, read all devices sensors (if it is Android device) and use them to do some other things, like control a motor, a servo and much more.
The same inversed is true, eg. ESP32 can have much more sensors attached, and it print out the values on a remote device screen, or can draw a graph, it even can open web pages, eg. place all sensor values to a Google Chart and display to a remote device the iteractive chart.
As explained, the library iteract with B4X, eg. I even impemented some methods relative to some B4X parts, eg, on the micro there are commands like tft.WriteFileText that from B4X side is recognized like File.WriteString, so the micro can pass just a file name and a file on remote device will be created with the passed text. Note that the text length is limited around 1000 characters only, but append can be used, so add more to existing files.
The library can even create CSV files on remote devices, eg, add headers and datas, can be used as data logger and much more.
Note that the library even have the command tft.deleteFile(FileName) to delete remote unused files.
These are all a small part of what this library can do.
This has much more, if you are curious take a look on it's header file I attached, even if you don't use any microcontroller at all.
I wish you both a happy Easter and thank you very much for your appreciated help that you have given me. I also accept ideas on my app, which perhaps I have missed but are clearer and more evident for B4X Gurus like you.
Bye and thanks