{"id":4009,"date":"2013-05-12T07:07:41","date_gmt":"2013-05-12T07:07:41","guid":{"rendered":"http:\/\/178.62.14.192\/?p=4009"},"modified":"2013-05-12T07:07:41","modified_gmt":"2013-05-12T07:07:41","slug":"raspberrypi-gpio-in-c","status":"publish","type":"post","link":"https:\/\/www.recantha.co.uk\/blog\/?p=4009","title":{"rendered":"RaspberryPi GPIO in C++"},"content":{"rendered":"<p>Hussam Al-Hertani over at hertaville.com has written an excellent tutorial, with code and breadboard diagram, on how to control the GPIO through C++.\u00a0<a href=\"http:\/\/hertaville.com\/2012\/11\/18\/introduction-to-accessing-the-raspberry-pis-gpio-in-c\/\">Read the tutorial here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hussam Al-Hertani over at hertaville.com has written an excellent tutorial, with code and breadboard diagram, on how to control the GPIO through C++.\u00a0Read the tutorial here<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/www.recantha.co.uk\/blog\/?p=4009\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[39,51],"tags":[],"class_list":["post-4009","post","type-post","status-publish","format-standard","hentry","category-programming","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>RaspberryPi GPIO in C++ - Raspberry Pi Pod<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.recantha.co.uk\/blog\/?p=4009\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RaspberryPi GPIO in C++ - Raspberry Pi Pod\" \/>\n<meta property=\"og:description\" content=\"Hussam Al-Hertani over at hertaville.com has written an excellent tutorial, with code and breadboard diagram, on how to control the GPIO through C++.\u00a0Read the tutorial hereRead more &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.recantha.co.uk\/blog\/?p=4009\" \/>\n<meta property=\"og:site_name\" content=\"Raspberry Pi Pod\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/recantha\/\" \/>\n<meta property=\"article:published_time\" content=\"2013-05-12T07:07:41+00:00\" \/>\n<meta name=\"author\" content=\"Michael Horne\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@recantha\" \/>\n<meta name=\"twitter:site\" content=\"@recantha\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Horne\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=4009#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=4009\"},\"author\":{\"name\":\"Michael Horne\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/c27c4ef2ee1c18b130f1fcd5dcdbb263\"},\"headline\":\"RaspberryPi GPIO in C++\",\"datePublished\":\"2013-05-12T07:07:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=4009\"},\"wordCount\":32,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#organization\"},\"articleSection\":[\"Programming\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.recantha.co.uk\/blog\/?p=4009#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=4009\",\"url\":\"https:\/\/www.recantha.co.uk\/blog\/?p=4009\",\"name\":\"RaspberryPi GPIO in C++ - Raspberry Pi Pod\",\"isPartOf\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#website\"},\"datePublished\":\"2013-05-12T07:07:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=4009#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.recantha.co.uk\/blog\/?p=4009\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=4009#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.recantha.co.uk\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RaspberryPi GPIO in C++\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#website\",\"url\":\"https:\/\/www.recantha.co.uk\/blog\/\",\"name\":\"Raspberry Pi Pod\",\"description\":\"Experiences with the Raspberry Pi micro computer and microcontroller\",\"publisher\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.recantha.co.uk\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#organization\",\"name\":\"Raspberry Pi Pod\",\"url\":\"https:\/\/www.recantha.co.uk\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2016\/03\/cropped-PiPod-Logo-v3.png?fit=800%2C337&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2016\/03\/cropped-PiPod-Logo-v3.png?fit=800%2C337&ssl=1\",\"width\":800,\"height\":337,\"caption\":\"Raspberry Pi Pod\"},\"image\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/recantha\/\",\"https:\/\/x.com\/recantha\",\"https:\/\/www.linkedin.com\/in\/recantha\/\",\"https:\/\/www.youtube.com\/channel\/UCK4F9blabxzmk8Inzhs8tpg\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/c27c4ef2ee1c18b130f1fcd5dcdbb263\",\"name\":\"Michael Horne\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/479778b0677caadde0ceb54c4129804ef674914607e3ed0998808148357d10d8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/479778b0677caadde0ceb54c4129804ef674914607e3ed0998808148357d10d8?s=96&d=mm&r=g\",\"caption\":\"Michael Horne\"},\"url\":\"https:\/\/www.recantha.co.uk\/blog\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"RaspberryPi GPIO in C++ - Raspberry Pi Pod","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.recantha.co.uk\/blog\/?p=4009","og_locale":"en_US","og_type":"article","og_title":"RaspberryPi GPIO in C++ - Raspberry Pi Pod","og_description":"Hussam Al-Hertani over at hertaville.com has written an excellent tutorial, with code and breadboard diagram, on how to control the GPIO through C++.\u00a0Read the tutorial hereRead more &rarr;","og_url":"https:\/\/www.recantha.co.uk\/blog\/?p=4009","og_site_name":"Raspberry Pi Pod","article_publisher":"https:\/\/www.facebook.com\/recantha\/","article_published_time":"2013-05-12T07:07:41+00:00","author":"Michael Horne","twitter_card":"summary_large_image","twitter_creator":"@recantha","twitter_site":"@recantha","twitter_misc":{"Written by":"Michael Horne"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.recantha.co.uk\/blog\/?p=4009#article","isPartOf":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=4009"},"author":{"name":"Michael Horne","@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/c27c4ef2ee1c18b130f1fcd5dcdbb263"},"headline":"RaspberryPi GPIO in C++","datePublished":"2013-05-12T07:07:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=4009"},"wordCount":32,"commentCount":1,"publisher":{"@id":"https:\/\/www.recantha.co.uk\/blog\/#organization"},"articleSection":["Programming","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.recantha.co.uk\/blog\/?p=4009#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.recantha.co.uk\/blog\/?p=4009","url":"https:\/\/www.recantha.co.uk\/blog\/?p=4009","name":"RaspberryPi GPIO in C++ - Raspberry Pi Pod","isPartOf":{"@id":"https:\/\/www.recantha.co.uk\/blog\/#website"},"datePublished":"2013-05-12T07:07:41+00:00","breadcrumb":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=4009#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.recantha.co.uk\/blog\/?p=4009"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.recantha.co.uk\/blog\/?p=4009#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.recantha.co.uk\/blog"},{"@type":"ListItem","position":2,"name":"RaspberryPi GPIO in C++"}]},{"@type":"WebSite","@id":"https:\/\/www.recantha.co.uk\/blog\/#website","url":"https:\/\/www.recantha.co.uk\/blog\/","name":"Raspberry Pi Pod","description":"Experiences with the Raspberry Pi micro computer and microcontroller","publisher":{"@id":"https:\/\/www.recantha.co.uk\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.recantha.co.uk\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.recantha.co.uk\/blog\/#organization","name":"Raspberry Pi Pod","url":"https:\/\/www.recantha.co.uk\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2016\/03\/cropped-PiPod-Logo-v3.png?fit=800%2C337&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2016\/03\/cropped-PiPod-Logo-v3.png?fit=800%2C337&ssl=1","width":800,"height":337,"caption":"Raspberry Pi Pod"},"image":{"@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/recantha\/","https:\/\/x.com\/recantha","https:\/\/www.linkedin.com\/in\/recantha\/","https:\/\/www.youtube.com\/channel\/UCK4F9blabxzmk8Inzhs8tpg"]},{"@type":"Person","@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/c27c4ef2ee1c18b130f1fcd5dcdbb263","name":"Michael Horne","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/479778b0677caadde0ceb54c4129804ef674914607e3ed0998808148357d10d8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/479778b0677caadde0ceb54c4129804ef674914607e3ed0998808148357d10d8?s=96&d=mm&r=g","caption":"Michael Horne"},"url":"https:\/\/www.recantha.co.uk\/blog\/?author=1"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2RsaV-12F","jetpack-related-posts":[{"id":14122,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=14122","url_meta":{"origin":4009,"position":0},"title":"Read analog sensors with the MCP3008 and GPIO Zero on the Raspberry Pi","author":"Michael Horne","date":"3 February 2016","format":false,"excerpt":"Alex Eames recently announced\u00a0a new reward level for his RasPiO Pro Hat Kickstarter - it includes an MCP3008 analog-to-digital chip and an analog temperature sensor (TMP36). Alex has now written a tutorial to show you how to use the chip and sensor to display temperature readings. The tutorial features the\u2026","rel":"","context":"In &quot;Crowdfunding&quot;","block_context":{"text":"Crowdfunding","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=13"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/raspi.tv\/wp-content\/uploads\/2016\/02\/ProHat-MCP3008-TMP36c.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/raspi.tv\/wp-content\/uploads\/2016\/02\/ProHat-MCP3008-TMP36c.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/raspi.tv\/wp-content\/uploads\/2016\/02\/ProHat-MCP3008-TMP36c.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/raspi.tv\/wp-content\/uploads\/2016\/02\/ProHat-MCP3008-TMP36c.png?resize=700%2C400 2x"},"classes":[]},{"id":10571,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=10571","url_meta":{"origin":4009,"position":1},"title":"Control the Raspberry Pi GPIO from Qt4","author":"Michael Horne","date":"31 July 2014","format":false,"excerpt":"Hussam Al-Hertani on his blog Hertaville has written a tutorial and given sample code for controlling the GPIO from within the Qt4 programming language. You need to install Qt in order to do it, but all that's covered by the tutorial. Read it here.","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=39"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/hertaville.com\/wp-content\/uploads\/2014\/07\/qtgpiooversshwx11.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/hertaville.com\/wp-content\/uploads\/2014\/07\/qtgpiooversshwx11.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/hertaville.com\/wp-content\/uploads\/2014\/07\/qtgpiooversshwx11.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/hertaville.com\/wp-content\/uploads\/2014\/07\/qtgpiooversshwx11.png?resize=700%2C400 2x, https:\/\/i0.wp.com\/hertaville.com\/wp-content\/uploads\/2014\/07\/qtgpiooversshwx11.png?resize=1050%2C600 3x, https:\/\/i0.wp.com\/hertaville.com\/wp-content\/uploads\/2014\/07\/qtgpiooversshwx11.png?resize=1400%2C800 4x"},"classes":[]},{"id":3744,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=3744","url_meta":{"origin":4009,"position":2},"title":"Scratch GPIO &#8211; control motors with Scratch on your #RaspberryPi","author":"Michael Horne","date":"23 April 2013","format":false,"excerpt":"Cymplecy continues his series on the new version of Scratch GPIO with a short tutorial on connecting motors up to the Pi via a ULN2003. PLEASE heed his warning about not connecting the motors directly to the Pi! Read more here","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=39"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3647,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=3647","url_meta":{"origin":4009,"position":3},"title":"JavaFX on the #RaspberryPi and the GPIO (part 2)","author":"Michael Horne","date":"18 April 2013","format":false,"excerpt":"Jens Deters has written the second part of a tutorial in using JavaFX on the Raspberry Pi to control the GPIO.\u00a0Read on here","rel":"","context":"In &quot;Java&quot;","block_context":{"text":"Java","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=28"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6268,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=6268","url_meta":{"origin":4009,"position":4},"title":"Interfacing a 16&#215;2 LCD with the #RaspberryPi","author":"Michael Horne","date":"4 October 2013","format":false,"excerpt":"Mark Williams has written a tutorial using C and WiringPi that shows you how to connect up a 16x2 LCD screen to the Pi. It's a great from-first-principles blog post.\u00a0Read it here","rel":"","context":"In &quot;GPIO boards&quot;","block_context":{"text":"GPIO boards","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=20"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16402,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=16402","url_meta":{"origin":4009,"position":5},"title":"Get started with Node-RED with this worksheet from the Raspberry Pi Foundation","author":"Michael Horne","date":"14 February 2017","format":false,"excerpt":"I've just spotted this new resource on the Raspberry Pi website's resources section. It shows you how to get started with controlling the Raspberry Pi's GPIO pins using visual programming language Node-RED. It's a nice tutorial and helps you get your head round some of the\u00a0intricacies of the language and\u2026","rel":"","context":"In &quot;Accessories&quot;","block_context":{"text":"Accessories","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=54"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2017\/02\/buttonlightsLED.gif?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2017\/02\/buttonlightsLED.gif?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2017\/02\/buttonlightsLED.gif?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4009"}],"version-history":[{"count":0,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4009\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}