alisonleeh / python-for-android

Automatically exported from code.google.com/p/python-for-android
Apache License 2.0
0 stars 0 forks source link

startSensingTimed syntax error #84

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
trying to run the following code on QPython installed on my Samsung Grand Duo:

import android # I also tryed using androidhelper with same result
import time
droid = android.Android()
dt = 100 #100ms between sensings
endTime = 3000 #sample for 3000ms timeSensed=0 droid.startSensingTimed(2,dt)
while timeSensed <= endTime:
     print droid.sensorsReadAccelerometer().result
     time.sleep(dt/1000.0)
     timeSensed+=dt
droid.stopSensing()

I expect it to print on the screen some data from the accelerometer, instead I 
receive the following error:

droid.startSensingTimed(2,dt)
                ^
SyntaxError: invalid syntax

I am using QPython 0.9.8.2 on Android 4.2.2

Could anybody help me to understand why it's not working, please?

Original issue reported on code.google.com by ing.ca...@gmail.com on 6 Aug 2014 at 8:45