qpython-android / qpython.org

QPython contributor & sugguestion & question homepage
http://qpython.org
57 stars 11 forks source link

Fail to use Bluetooth of Androidhelper #113

Open kevin-wang2 opened 8 years ago

kevin-wang2 commented 8 years ago

If I use API bluetoothConnect, it returns nothing.And I suppose it's right so I use bluetoothWrite function.However, it returns NULLPointerError. How can I solve it? PS.The remote bluetooth device is an HC-06 bluetooth module connected to the Arduino. And tests are made successfully to use it on the app Amarino.

riverfor commented 8 years ago

Can you post your script code here ?

kevin-wang2 commented 8 years ago

BT.bluetoothConnect(' 00001101-0000-1000-8000-00805F9B34FB')

def BTSend(_MotPany): global BT,Outline print MotPany x=0 x+=0 if MotPany[0]>=Window.center[1] else 0x80 x+=int((0x07_abs(MotPany[0]-Window.center[1]))/Window.center[1])<<4 x&=0xF0 x+=0 if MotPany[1]>=Window.center[1] else 0x08 x+=int(0x07*float(abs(MotPany[1]-Window.center[1]))/Window.center[1]) if Outline: print hex(x) return BT.Write(chr(x))

JasonJunjieXu commented 4 years ago

Hi, I meet the same problem as you. Did you get the result in the end?