[Resuelto] SPI and I2C
You can communicate with I2C or SPI with a simple "run once" python script...
Each time that you call the script It must return your data formated in string.
You can do it and test it througt the linux or windows terminal, when you execute the script you could see the response of the module formated as you has programmed in the script...
There is a good example of something similar at:
When you finish do this step you will be able to call your script from MyOpenLab with the "CMD_Write_JV" element and It will get the terminal response, the you can format and show it in MyOpenLab Interface.
There is an example of the "CMD_Write_JV" located at:
VirtualMachines > English Examples > Application_Control > cmdWrite_JV_Example
The next distribution will include a element to use the I2C Raspberry PI port, but I am developing more front panel elements, Pipeline, tanks, valves, new boolean controls and Indicators, Temperature indicators, Gauge indicators and I am fixing bugs first.
Are you using Raspberry I2C Port? If Yes:
To do a VM that can communicate with I2C you can write your own Python Script and you can get the result with MyOpenLab trought the Linux Terminal with the "CMD_Write_JV" element.
Your Python Script should be "once time execution" and It should query the sensor and return the response. By Example you can see how works the Wiring PI Library, if you type in the Linux Terminal "digitalRead (int pin) " It returns an integer 0 or 1 depending of the pin status.
When you finish your Python script and you can execute it from terminal and get the response
you will be ready to implement it on MyOpenLab.
There is an example of the "CMD Write_JV" example located at:
Envía a la terminal el comando que se ponga como entrada, si no lo ejecuta puede ser un error de la máquina de Java al enviar esos comandos múltiples, por el momento tocaría que llame directamente al script con la ruta fija y que el script sea el que ejecute toda la secuencia de comandos necesaria.