I want to make a system call out of a Matlab Simulink model running on external hardware. In my case I want to switch the original Raspberry Pi Touch Display (7") off and an.
I tried using a Matlab function with a Matlab "system" command but it just doesn't have any affect on the display (the system calls itself works with the terminal).
function display_backlight(old_status)
coder.extrinsic('system')
if old_status == 1
system('echo 1 | sudo tee /sys/class/backlight/rpi_backlight/bl_power')
else
system('echo 0 | sudo tee /sys/class/backlight/rpi_backlight/bl_power')
end
end
Any ideas how to make this work or do I need to use another block like mentioned here System call from Simulink possible? (Link in the answer doesn't work)
Or do I even have to write this in C and integrate this to Simulink?