diff --git a/README.md b/README.md index b010199..547b540 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Create a Python file and import the class library from package: ```python from model2450lib import searchmodel from model2450lib import model2450 +import time ``` ### Listed out the Model2450 @@ -90,4 +91,5 @@ sw1.get_version() ## Release History +- v1.0.1 update examples - v1.0.0 initial release diff --git a/example/01_commands.py b/example/01_commands.py new file mode 100644 index 0000000..5eef775 --- /dev/null +++ b/example/01_commands.py @@ -0,0 +1,36 @@ +# avalaible list of MCCI Switches with port number +# from model2450 import searchswitch + +# import searchswitch +# import switch2450 + +import time +from model2450lib import searchmodel +from model2450lib import model2450 +# found a list of available switches. +# using the port number open the switch. +dev_list = searchmodel.get_models() +print(dev_list) + +# Replace 'COMX' with the appropriate COM port for Model2450 +sw1 = model2450.Model2450('COM10') +# print("switch 2450 connected:", sw1) +# Connect the USB Switch +sw1.connect() +print("Connected switch 2450:") + +sn= sw1.read_sn() # cmd for read serial number +print(sn) + +time.sleep(1) +gread = sw1.get_read() # cmd for read the ambient light sensor +print(gread) + +time.sleep(1) +glevel = sw1.get_level() # cmd for read the light level for detecting blank frames +print(glevel) + +time.sleep(1) +gcolor = sw1.get_color() # display the color reading +print(gcolor) + diff --git a/example/02_blackframes.py b/example/02_blackframes.py new file mode 100644 index 0000000..52efa60 --- /dev/null +++ b/example/02_blackframes.py @@ -0,0 +1,44 @@ + + +# import searchswitch +# import switch2450 + +import time +from model2450lib import searchmodel +from model2450lib import model2450 +# found a list of available switches. +# using the port number open the switch. +dev_list = searchmodel.get_models() +print(dev_list) + +# Replace 'COMX' with the appropriate COM port for Model2450 +sw1 = model2450.Model2450('COM10') +# print("switch 2450 connected:", sw1) +# Connect the USB Switch +sw1.connect() +print("Connected switch 2450:") + +sn= sw1.read_sn() # cmd for read serial number +print(sn) + +time.sleep(1) +gread = sw1.get_read() # cmd for read the ambient light sensor +print(gread) + +time.sleep(1) +glevel = sw1.get_level() # cmd for read the light level for detecting blank frames +print(glevel) + +time.sleep(1) +gcolor = sw1.get_color() # display the color reading +print(gcolor) + + +bc = sw1.set_run() # look for black frames +print("bc count started:") + +time.sleep(10) +bc = sw1.set_stop() # stop looking for black frames and print the results + +print(bc) + diff --git a/example/test_model2450.py b/example/test_model2450.py deleted file mode 100644 index 34ce7d2..0000000 --- a/example/test_model2450.py +++ /dev/null @@ -1,44 +0,0 @@ -# avalaible list of MCCI Switches with port number -# from model2450 import searchswitch - -# import searchswitch -# import switch2450 - -import time -from model2450lib import searchmodel -from model2450lib import model2450 -# found a list of available switches. -# using the port number open the switch. -dev_list = searchmodel.get_models() -print(dev_list) - -sw1 = model2450.Model2450('COM4') -# print("switch 2450 connected:", sw1) -# Connect the USB Switch -sw1.connect() -print("Connected switch 2450:") - - -time.sleep(1) -sRun = sw1.set_run() -print("run blank frames....:") - -time.sleep(10) -rStop = sw1.set_stop() -print("stop blank frames....:") - -# time.sleep(1) -# ser = sw1.read_sn() # READ SERIAL NUMBER -# print(ser) -# time.sleep(1) -# ver = sw1.get_version() # VERSION F:H -# print(ver) -# time.sleep(1) -# gRead = sw1.get_read() # READ -# print(gRead) -# time.sleep(1) -# cRead = sw1.get_color() # COLOR Values -# print(cRead) -# time.sleep(1) -# lRead = sw1.get_level() # LEVEL -# print(lRead) diff --git a/setup.py b/setup.py index a7bd3f1..28d1918 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup( name='model2450lib', - version='1.0.0', + version='1.0.1', description='API for MCCI Model2450', author='Vinay N MCCI Corporation', author_email='',