updated to fit new acceleration and time/millis

Changed pyb.accel() and pyb.time() to the new pyb.Accel() object and pyb.millis() function.
Also shortened the loop so the writing is finished before the USB connection messes things up.
Merge pull request #561 from turbinenreiter/patch-1

updated to fit new acceleration and time/millis