{"id":635,"date":"2019-02-06T03:06:15","date_gmt":"2019-02-05T20:06:15","guid":{"rendered":"http:\/\/class.ajarnsunny.com\/?page_id=635"},"modified":"2019-02-06T03:09:42","modified_gmt":"2019-02-05T20:09:42","slug":"example-1","status":"publish","type":"page","link":"http:\/\/class.ajarnsunny.com\/?page_id=635","title":{"rendered":"Example 1"},"content":{"rendered":"<div id=\"themify_builder_content-635\" data-postid=\"635\" class=\"themify_builder_content themify_builder_content-635 themify_builder\">\n\n    \t\n\t\t<!-- module_row -->\n\t\t\t<div  class=\"themify_builder_row module_row clearfix module_row_0 themify_builder_635_row module_row_635-0\">\n\t\t\t\t                                <div class=\"row_inner \" >\n\n                                    \n\t\t<div  class=\"tb-column col-full first module_column tb_635_column module_column_0 module_column_635-0-0\" >\n                                                                <div class=\"tb-column-inner\">\n                            \n\n<!-- module text -->\n<div  id=\"text-635-0-0-0\" class=\"module module-text text-635-0-0-0  repeat \">\n    \n    <p><strong>Example 1.1<\/strong><\/p>\n<p>Make the following connections (see\u00a0<a href=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/01\/ex01.jpg\">picture<\/a>):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-85\" src=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/01\/ex01-1024x575.jpg\" alt=\"\" width=\"1024\" height=\"575\" srcset=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/01\/ex01-1024x575.jpg 1024w, http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/01\/ex01-300x169.jpg 300w, http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/01\/ex01-768x431.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><br \/>Connect\u00a0<strong>PIN 25 (GROUND)<\/strong>\u00a0of the Raspberry Pi to the\u00a0<strong>GND<\/strong>\u00a0of the experiment board.<br \/>Connect\u00a0<strong>PIN 22<\/strong>\u00a0of the Raspberry Pi to LED 0 of the Lower Monitor on the experiment board.<\/p>\n<p>Then, run the following program (file\u00a0<a href=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/01\/Example1_1.txt\">Example1_1<\/a>):<\/p>\n<p>import RPi.GPIO as GPIO # Import library for GPIO (pin) access<br \/>GPIO.setmode(GPIO.BOARD) # Specify that we use the BOARD numbers (pin numbers 1-40 on the connector)<br \/>GPIO.setwarnings(False) # Disable the warning \u201cThis channel is already in use\u201d<\/p>\n<p># ******** PIN CONFIGURATION *************************************<br \/>GPIO.setup(22, GPIO.OUT) # Configure pin 22 as an output (OUT)<br \/># ****************************************************************<\/p>\n<p>GPIO.output(22, 1) # Send a logic 1 to pin 22, i.e. turn on the LED connected to pin 22<\/p>\n<p>The program\u00a0<strong>turns on<\/strong>\u00a0LED 0 as you can see in this\u00a0<a href=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/01\/ex01output.jpg\">picture<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-87\" src=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/01\/ex01output-1024x575.jpg\" alt=\"\" width=\"1024\" height=\"575\" srcset=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/01\/ex01output-1024x575.jpg 1024w, http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/01\/ex01output-300x169.jpg 300w, http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/01\/ex01output-768x431.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><strong>Assignment 1.A<\/strong><br \/>After running Example 1.1, LED 0 is turned on. Now modify the program so that it turns off LED 0.<\/p><\/div>\n<!-- \/module text -->\n                        <\/div>\n                    \t\t<\/div>\n\t\t<!-- \/.tb-column -->\n\t\t\n\t\t\n                                <\/div>\n                                <!-- \/row_inner -->\n                        <\/div>\n                        <!-- \/module_row -->\n\t\t<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Example 1.1 Make the following connections (see\u00a0picture): Connect\u00a0PIN 25 (GROUND)\u00a0of the Raspberry Pi to the\u00a0GND\u00a0of the experiment board.Connect\u00a0PIN 22\u00a0of the Raspberry Pi to LED 0 of the Lower Monitor on the experiment board. Then, run the following program (file\u00a0Example1_1): import RPi.GPIO as GPIO # Import library for GPIO (pin) accessGPIO.setmode(GPIO.BOARD) # Specify that we use [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-635","page","type-page","status-publish","hentry","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=\/wp\/v2\/pages\/635"}],"collection":[{"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=635"}],"version-history":[{"count":5,"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=\/wp\/v2\/pages\/635\/revisions"}],"predecessor-version":[{"id":642,"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=\/wp\/v2\/pages\/635\/revisions\/642"}],"wp:attachment":[{"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}