New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create #124

wants to merge 1 commit into
base: master
Jump to file or symbol
Failed to load files and symbols.
+44 −0
Diff settings


Just for now


  • Loading branch information...
markusorngren committed Jan 8, 2018
commit 86ad9d027c04b57822b333ea8659b4072a639e44
@@ -0,0 +1,44 @@
# create services
from org.myrobotlab.service import Arduino
from org.myrobotlab.service import Servo
from org.myrobotlab.service import Runtime
python = Runtime.start("python", "Python")
keyboard = Runtime.start("keyboard", "Keyboard")
python.subscribe("keyboard", "publishMouseMoved")
servoPin = 3
servo2Pin = 4
comPort = "COM10"
# start the service
arduino = Runtime.start("arduino","Arduino")
servo01 = Runtime.start("servo01","Servo")
servo02 = Runtime.start("servo02","Servo")
servo01.setMinMax(0, 180)
servo01.attach(arduino.getName(), servoPin),180,180,0)
#servo01.setSpeed(1.0) # set speed to 100% of full speed
servo02.setMinMax(0, 180)
servo02.attach(arduino.getName(), servo2Pin),180,180,0)
#servo02.setSpeed(1.0) # set speed to 100% of full speed
# non blocking event example
def onKey(key):
print ("you pressed ", key)
def onMouseMoved(mouseEvent):
x = mouseEvent.pos.x / 10
x = ("%.0f"%x)
y = mouseEvent.pos.y / 5.6
y = ("%.0f"%y)
print ("x ", x, " y ", y)
ProTip! Use n and p to navigate between commits in a pull request.