If you talk about mutex, then I guess you want to modify the robot program to have the display code included. Perhaps you want to display some robot status on the display. Mutex are used to synchronize threads, but exist only in one program; not between programs.
The Pi4 has two SPI ports . See https://pinout.xyz/pinout/spi . Perhaps easier to use the other port for the display instead of sharing the port with the robot functions. As this robot has a 'hat style' board it will need some rewiring to have the display connected.
Would be useful to have a schema of this robot board (the webpages of this GoPiGo3 at first glance do not have a link like 'here is the schema'). Needed to know which GPIO pins are used and e.g. to see whether a second SPI is fully available.
Would also be useful to have a link to the robot source code, e.g. on github.
Same for the waveshare display you are using.
Another option to connect a display is to use a microcontroller which connects the display and send data to display using UART (if these pins are not used by the robot). A pico RP2040 could do this job.
The Pi4 has two SPI ports . See https://pinout.xyz/pinout/spi . Perhaps easier to use the other port for the display instead of sharing the port with the robot functions. As this robot has a 'hat style' board it will need some rewiring to have the display connected.
Would be useful to have a schema of this robot board (the webpages of this GoPiGo3 at first glance do not have a link like 'here is the schema'). Needed to know which GPIO pins are used and e.g. to see whether a second SPI is fully available.
Would also be useful to have a link to the robot source code, e.g. on github.
Same for the waveshare display you are using.
These requirements are too strict. If you want to have the display code merged with the robot code, then the requirement is to have the SPI access snychronized within one program.SPI communication is intrinsic to the entire robot at a fundamental system level so whatever I do has to be absolutely global in nature, must exist at boot, (or whenever Python kicks in), and must persist across reboots.
Another option to connect a display is to use a microcontroller which connects the display and send data to display using UART (if these pins are not used by the robot). A pico RP2040 could do this job.
Statistics: Posted by ghp — Sun Jun 30, 2024 1:58 pm