Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Mobile Phone Gui moved into symbainS60 folder

  • Loading branch information...
commit 707a1492659c8377819e800e50d1c74df45ae1e6 1 parent 99003f3
@hmms authored
View
96 GUI/Mobile/RGB_led_controller.py → GUI/Mobile/SymbainS60/RGB_led_controller.py
@@ -1,49 +1,49 @@
-import appuifw
-import btsocket as socket
-import e32
-
-class BTReader:
- def connect(self):
- global sock
- arduino_addr='00:19:a4:02:44:2a' #add your arduino BT adress here
- sock=socket.socket(socket.AF_BT, socket.SOCK_STREAM)
- target=(arduino_addr,1) # serial connection to arduino BT
- sock.connect(target)
-
- def readline(self):
- line=[]
- while 1:
- ch=self.sock.recv(1)
- if(ch=="A"):
- break
- line.append(ch)
- return ''.join(line)
- def writechar(ch):
- # ch="1";
- self.sock.send(ch);
- def close(self):
- self.sock.close();
-
-bt=BTReader()
-bt.connect()
-
-mode = appuifw.query(u"MODE","number")
-red_val = appuifw.query(u"RED","number")
-green_val = appuifw.query(u"GREEN","number")
-blue_val = appuifw.query(u"BLUE","number")
-delay_val = appuifw.query(u"Delay","number")
-
-m_str = "m" + str(mode)
-sock.send(m_str)
-
-r_str = "r" + chr(int(red_val))
-sock.send(r_str)
-
-g_str = "g" + chr(int(green_val))
-sock.send(g_str)
-
-b_str = "b" + chr(int(blue_val))
-sock.send(b_str)
-
-d_str = "d" + chr(int(delay_val))
+import appuifw
+import btsocket as socket
+import e32
+
+class BTReader:
+ def connect(self):
+ global sock
+ arduino_addr='00:19:a4:02:44:2a' #add your arduino BT adress here
+ sock=socket.socket(socket.AF_BT, socket.SOCK_STREAM)
+ target=(arduino_addr,1) # serial connection to arduino BT
+ sock.connect(target)
+
+ def readline(self):
+ line=[]
+ while 1:
+ ch=self.sock.recv(1)
+ if(ch=="A"):
+ break
+ line.append(ch)
+ return ''.join(line)
+ def writechar(ch):
+ # ch="1";
+ self.sock.send(ch);
+ def close(self):
+ self.sock.close();
+
+bt=BTReader()
+bt.connect()
+
+mode = appuifw.query(u"MODE","number")
+red_val = appuifw.query(u"RED","number")
+green_val = appuifw.query(u"GREEN","number")
+blue_val = appuifw.query(u"BLUE","number")
+delay_val = appuifw.query(u"Delay","number")
+
+m_str = "m" + str(mode)
+sock.send(m_str)
+
+r_str = "r" + chr(int(red_val))
+sock.send(r_str)
+
+g_str = "g" + chr(int(green_val))
+sock.send(g_str)
+
+b_str = "b" + chr(int(blue_val))
+sock.send(b_str)
+
+d_str = "d" + chr(int(delay_val))
sock.send(d_str)
View
96 GUI/Mobile/RGB_led_controller_mobile.py → ...e/SymbainS60/RGB_led_controller_mobile.py
@@ -1,49 +1,49 @@
-import appuifw
-import btsocket as socket
-import e32
-
-class BTReader:
- def connect(self):
- global sock
- arduino_addr='00:19:a4:02:44:2a' #add your arduino BT adress here
- sock=socket.socket(socket.AF_BT, socket.SOCK_STREAM)
- target=(arduino_addr,1) # serial connection to arduino BT
- sock.connect(target)
-
- def readline(self):
- line=[]
- while 1:
- ch=self.sock.recv(1)
- if(ch=="A"):
- break
- line.append(ch)
- return ''.join(line)
- def writechar(ch):
- # ch="1";
- self.sock.send(ch);
- def close(self):
- self.sock.close();
-
-bt=BTReader()
-bt.connect()
-
-mode = appuifw.query(u"MODE","number")
-red_val = appuifw.query(u"RED","number")
-green_val = appuifw.query(u"GREEN","number")
-blue_val = appuifw.query(u"BLUE","number")
-delay_val = appuifw.query(u"Delay","number")
-
-m_str = "m" + str(mode)
-sock.send(m_str)
-
-r_str = "r" + chr(int(red_val))
-sock.send(r_str)
-
-g_str = "g" + chr(int(green_val))
-sock.send(g_str)
-
-b_str = "b" + chr(int(blue_val))
-sock.send(b_str)
-
-d_str = "d" + chr(int(delay_val))
+import appuifw
+import btsocket as socket
+import e32
+
+class BTReader:
+ def connect(self):
+ global sock
+ arduino_addr='00:19:a4:02:44:2a' #add your arduino BT adress here
+ sock=socket.socket(socket.AF_BT, socket.SOCK_STREAM)
+ target=(arduino_addr,1) # serial connection to arduino BT
+ sock.connect(target)
+
+ def readline(self):
+ line=[]
+ while 1:
+ ch=self.sock.recv(1)
+ if(ch=="A"):
+ break
+ line.append(ch)
+ return ''.join(line)
+ def writechar(ch):
+ # ch="1";
+ self.sock.send(ch);
+ def close(self):
+ self.sock.close();
+
+bt=BTReader()
+bt.connect()
+
+mode = appuifw.query(u"MODE","number")
+red_val = appuifw.query(u"RED","number")
+green_val = appuifw.query(u"GREEN","number")
+blue_val = appuifw.query(u"BLUE","number")
+delay_val = appuifw.query(u"Delay","number")
+
+m_str = "m" + str(mode)
+sock.send(m_str)
+
+r_str = "r" + chr(int(red_val))
+sock.send(r_str)
+
+g_str = "g" + chr(int(green_val))
+sock.send(g_str)
+
+b_str = "b" + chr(int(blue_val))
+sock.send(b_str)
+
+d_str = "d" + chr(int(delay_val))
sock.send(d_str)
Please sign in to comment.
Something went wrong with that request. Please try again.