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

Making your home learn

Once this constitution is done, go ahead and wire it up, as shown here:

Once that is set, it is time for us to write the following code on to our Raspberry Pi:

import Adafruit_DHTimport datetimeimport RPi.GPIO as GPIOimport timeimport numpy as npimport pandas as pdimport Adafruit_DHTfrom sklearn.neighbors import KNeighborsClassifierGPIO.setmode(GPIO.BCM)GPIO.setwarnings(False)fan = 22light = 23sw1 = 13sw2 = 14GPIO.setup(led1,GPIO.OUT)GPIO.setup(led2,GPIO.OUT)GPIO.setup(sw1,GPIO.IN)GPIO.setup(sw2,GPIO.IN)sensor = 11pin = 2f = open("dataset.csv","a+")count = 0while count < 50: data = "" H = datetime.datetime.now().strftime('%H') ...
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