{"id":505,"date":"2014-09-11T15:52:58","date_gmt":"2014-09-11T15:52:58","guid":{"rendered":"http:\/\/4tronix.co.uk\/blog\/?p=505"},"modified":"2014-09-11T15:52:58","modified_gmt":"2014-09-11T15:52:58","slug":"programming-pirocon-in-python","status":"publish","type":"post","link":"https:\/\/4tronix.co.uk\/blog\/?p=505","title":{"rendered":"Programming PiRoCon in Python"},"content":{"rendered":"<h3>Python<\/h3>\n<p>We have created a python library that makes programming PiRoCon and Initio very simple.<\/p>\n<p>If you are using the PiRoCon on a different robot, you may need to change some of the pin assignments used, but the code itself should be fine<\/p>\n<p>Raspberry Pi Python examples can be downloaded from an LXterminal session and connected to the internet, type in or copy and paste:<\/p>\n<address>wget http:\/\/4tronix.co.uk\/initio.sh -O initio.sh<\/address>\n<p>Then type in:<\/p>\n<address>bash initio.sh<\/address>\n<p>You will then have a number of python examples to try. Run them with<\/p>\n<address>sudo python filename.py<\/address>\n<ul>\n<li>motorTest2.py:\u00a0 use the arrow keys to move forwards and backwards, spin left or spin right. Space to stop. Use . and , to increase or decrease speed<\/li>\n<li>sonarTest.py: Prints the distance in centimetres from the ultrasonic sensor, once every second<\/li>\n<li>irTest.py: Prints the state of the IR line and obstacles sensors, every time the state changes.<\/li>\n<li>servoTest.py:\u00a0 use the arrow keys to pan and tilt<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Python We have created a python library that makes programming PiRoCon and Initio very simple. If you are using the PiRoCon on a different robot, you may need to change some of the pin assignments used, but the code itself should be fine Raspberry Pi Python examples can be downloaded from an LXterminal session and &hellip; <a href=\"https:\/\/4tronix.co.uk\/blog\/?p=505\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Programming PiRoCon in Python<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-505","post","type-post","status-publish","format-standard","hentry","category-robotics-for-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=505"}],"version-history":[{"count":1,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/505\/revisions"}],"predecessor-version":[{"id":506,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/505\/revisions\/506"}],"wp:attachment":[{"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}