This is my make-through for the week's assignment. Grab a cup of coffee!
in this week we will learn how to use raspberry pi
for it's not my first time I used raspberry pi many time but just for software level as a webserver or cluster computer and didn't used it with GPIO at all
the table to the right descripe the main deffrance in advantage and disadvantage between RPI and Arduino or other AVR
in my opnion the main deffranc is that RPI have Micro.Processor instead of microcontroller in arduino which is more faster and powerfull
first we need to confirm that GPIO pin Library is setup on raspberry pi it should be pre installed by default but if it's not working you can re install it again from terminal using apt-get
$ sudo apt-get update
$ sudo apt-get install python-rpi.gpio python3-rpi.gpio
First we need to understand the pinout of RPI
it have 5V ,3.3V , GND and other GPIO PINs
it also have 2 mode for indexing pins (BCM or Board Number)
you need to define this index on you code
after that you need to define pin for led and push button
and setup button to use built-in pull up restestance
then we create while true loop that act as void loop in arduino
and check if button state is 1 turn on le els turn of led