How can I replace “cat” and “echo” read/write command with python/c program?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
0
I have trouble replacing device in/output commands like: echo 100 > /dev/rtmotor_raw_l0 # output 100hz frequency cat /dev/rtswitch0 # read switch state output problem(python) I tried replacing that command with python. file = open('/dev/rtmotor_raw_l0','w') file.write('100n') # I want output in this timing file.close() # output reflected after closing file The problem is that the output appears after closing the file. Does this mean I have to open and close this device each time I want to change its value? Also, changing 'w' to 'a' did no...