Commit 0642c568 authored by Simon M. Haller-Seeber's avatar Simon M. Haller-Seeber
Browse files

Added LSS examples

parent 2140f5f2
......@@ -32,6 +32,9 @@ print("myLSS1; position = " + str(myLSS1.getPosition()))
myLSS1.move(300)
time.sleep(1)
print("myLSS1; position = " + str(myLSS1.getPosition()))
myLSS1.move(0)
time.sleep(1)
print("myLSS1; position = " + str(myLSS1.getPosition()))
myLSS1.reset()
del myLSS1
......
###############################################################################
# Author: Sebastien Parent-Charette (support@robotshop.com)
# Version: 1.0.0
# Licence: LGPL-3.0 (GNU Lesser General Public License version 3)
#
# Desscription: An example using the LSS and the Python module.
###############################################################################
# Import required liraries
import time
import serial
# Import LSS library
import lss
import lss_const as lssc
# Constants
CST_LSS_Port = "/dev/ttyUSB0" # For Linux/Unix platforms
CST_LSS_Baud = lssc.LSS_DefaultBaud
# Create and open a serial port
lss.initBus(CST_LSS_Port, CST_LSS_Baud)
# Create LSS objects
myLSS0 = lss.LSS(0)
myLSS1 = lss.LSS(1)
myLSS0.move(600)
myLSS1.move(600)
time.sleep(1)
myLSS0.move(-600)
time.sleep(1)
myLSS0.move(0)
myLSS1.move(800)
time.sleep(1)
myLSS1.reset()
myLSS0.reset()
del myLSS1
del myLSS0
# Destroy the bus
lss.closeBus()
### EOF #######################################################################
###############################################################################
# Author: Sebastien Parent-Charette (support@robotshop.com)
# Version: 1.0.0
# Licence: LGPL-3.0 (GNU Lesser General Public License version 3)
#
# Desscription: An example using the LSS and the Python module.
###############################################################################
# Import required liraries
import time
import serial
# Import LSS library
import lss
import lss_const as lssc
# Constants
CST_LSS_Port = "/dev/ttyUSB0" # For Linux/Unix platforms
CST_LSS_Baud = lssc.LSS_DefaultBaud
# Create and open a serial port
lss.initBus(CST_LSS_Port, CST_LSS_Baud)
# Create LSS objects
myLSS0 = lss.LSS(0)
myLSS1 = lss.LSS(1)
myLSS2 = lss.LSS(2)
myLSS3 = lss.LSS(3)
myLSS4 = lss.LSS(4)
myLSS0.move(600)
myLSS1.move(600)
myLSS2.move(400)
time.sleep(1)
myLSS0.move(0)
myLSS3.move(-200)
myLSS4.move(0)
#myLSS0.move(-600)
time.sleep(1)
myLSS2.move(0)
myLSS3.move(200)
myLSS4.move(500)
time.sleep(1)
#myLSS0.move(0)
#myLSS1.move(800)
#time.sleep(1)
print("myLSS1; position = " + str(myLSS1.getPosition()))
print("myLSS2; position = " + str(myLSS2.getPosition()))
print("myLSS3; position = " + str(myLSS3.getPosition()))
print("myLSS4; position = " + str(myLSS4.getPosition()))
#myLSS0.reset()
#myLSS1.reset()
#myLSS2.reset()
#myLSS3.reset()
#myLSS4.reset()
#del myLSS0
#del myLSS1
#del myLSS2
#del myLSS3
#del myLSS4
# Destroy the bus
lss.closeBus()
### EOF #######################################################################
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment