Skip to Content
Python Robotics Projects
book

Python Robotics Projects

by Prof. Diwakar Vaish
May 2018
Intermediate to advanced
340 pages
7h 20m
English
Packt Publishing
Content preview from Python Robotics Projects

Gesture recognition-based automation

Now we have interfaced the connections as per the following diagram:

Let's go ahead and upload the following code:

import signalimport flicklibimport timeimport RPi.GPIO as GPIOGIPO.setmode(GPIO.BCM)GPIO.setup(light, GPIO.OUT)GPIO.setup(fan,GPIO.OUT)pwm = GPIO.PWM(fan,100)def message(value):   print value@flicklib.move()def move(x, y, z):   global xyztxt   xyztxt = '{:5.3f} {:5.3f} {:5.3f}'.format(x,y,z)@flicklib.flick()def flick(start,finish):   global flicktxt   flicktxt = 'FLICK-' + start[0].upper() + finish[0].upper()   message(flicktxt)def main():   global xyztxt   global flicktxt   xyztxt = ''   flicktxt = '' flickcount ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Robotics using Python

Learning Robotics using Python

Lentin Joseph
Hands-On ROS for Robotics Programming

Hands-On ROS for Robotics Programming

Bernardo Ronquillo Japón

Publisher Resources

ISBN: 9781788832922Supplemental Content