I know, but I had a similar problem implementing a class for GPIO usage, where I had to seek(0) before a new value would be accepted. This is probably implementation dependent. I have no idea how this "file" mechanism works though. Is it using a pipe? If so a seek would indeed be useless.BlackJack wrote:@Aydan: We are not talking about a regular file here but a device driver. If it can not cope with more than one line I doubt it implements seek behaviour. Flushing might be worth a try.
Code: Select all
s1=0 s2=0 sb=open("/dev/servoblaster","w") sb.write("0="+str(s1)+"\n") sb.flush() sb.write("1="+str(s2)+"\n") sb.flush() sb.close()