05-07-2023, 03:32 PM
(05-07-2023, 02:30 PM)Dr. Mario Wrote: Hello!I think it is better to control GPIO with variables V[] values.
Where can I find sample code for Arduino IDE ESP8266 with text messaging between the controller and Virtuino 6 CM, and the Virtuino6 project itself?
I installed the VirtuinoCM library, so far I managed to control the GPIO.
I can't figure out how to receive and send text from ESP to Virtuino6 project.
If you only want to send and receive text values, you can:
1 - use the example sketch (for esp8266 and ESP32 with VirtuinoCM): Wemos_NodeMCU_ESP8266_Vmemory_text.ino
This example adds the "if" condition to handle the each case of text variables V0, V1..: if (variableIndex==0) V0 = valueAsText;
2 - proceed as I explained above. This example:
- declare a text array: String T[10]; // array for 10 text values.
- initialize T[1]="", T[2] = "", ...
or T[eSsidNetwork] = ""; if you want to use enum
- then as I wrote, add if conditions to process the text array:
if (variableType == 'T') {T[variableIndex] = valueAsText;}