blob: 22e0bcf6c5bef83145a105c878a5505b475c550b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import os
import sys
cwd=os.getcwd()
(setpath,Examples)=os.path.split(cwd)
#print setpath
sys.path.append(setpath)
from Arduino.Arduino import Arduino
from time import sleep
class TEST_FIRMWARE:
def __init__(self,baudrate):
self.baudrate=baudrate
self.setup()
self.run()
self.exit()
def setup(self):
self.obj_arduino=Arduino()
self.port=self.obj_arduino.locateport()
self.obj_arduino.open_serial(1,self.port,self.baudrate)
def run(self):
self.obj_arduino.checkfirmware()
def exit(self):
self.obj_arduino.close_serial()
def main():
obj_led=TEST_FIRMWARE(115200)
if __name__== '__main__':
main()
|