Introduction: Raspberry Pi Tutorial
Today I,m gonna tell you how to program the Raspberry Pi or i should say how to program using Raspberry pi.
Note: I,m not gonna teach Python Language here.
Many people find it difficult to do programming using Raspberry pi. So i decided to create a Step by Step guide to create python scripts and running them using different techniques.
Step 1: Requirements:
We gonna need following items:
1. Raspberry pi x1
2. A HDMI display or VGA monitor with hdmi to vga converter x1
3. 5v-2A power supply for Raspberry pi(Cell phone charger is good) x1
4. Optical mouse x1
5. Keyboard x1
6. Micro SD card (4 GB- 4 class minimum, higher is better) x1
7. A Computer
Step 2: Getting Things Ready:
First of all we have to download the OS for our Raspberry pi. To do this go to Click here to Download Raspbian OS
. You can also Go to Raspberry pi OS - All and select among various third party OS. Meanwhile this tutorial is using Raspbian OS.
After Downloading the OS we need to prepare memory card for OS. we need to format the card and burn the image on SD card. to do this we will need two Software.
Step 3: Loading OS to SD Card:
To laod the OS in SD card. first plugin the SD card into your PC and Format it using SD card Formatter.
After successful completion of formatting open the win32 disk imager and choose the Raspbian OS image you just downloaded. Choose the SD card in drive column. Please ensure that you have selected the SD card drive or you may corrupt your PC if you select any of it's drives.
Then click on Write to Start the process. It may be time consuming depending class of your SD card.
When this process is completed. unplug your SD card and insert in Raspberry pi.
Step 4: Booting Raspberry Pi:
Connect the Keyboard, Mouse and Monitor to the Raspberry pi. And then switch on the power.
There is another way to reduce the need of the monitor, mouse and keyboard. For that you have connect your Raspberry pi to LAN cable and use SSH terminal to control it via PC. I,m using second method as i don't have the required accessories. However Programming will be same for both the methods.
Now when you switch on the power your Raspberry pi will boot into Raspbian OS. you will see a black screen scrolling down and then Raspberry logo. it may ask you for user name and password. if it does you should enter the default credentials i.e. username- pi , pswd- raspberry
in no time you will be looking at desktop of raspberry pi. Congratulations your Raspberry pi computer is raedy.
Step 5: Programming:
Now click on start icon and get into programming >Python 2 / Python 3
click upon your desired python IDE. i,m gonna use pyhton 3.
when you open the python ide you will get the Python shell window. now to create new file go to File>New Window
a new python window will be in front of you. write down your code here.
Note: I,m not gonna teach here Python language.
After writing the code click on RUN option. RUN>RUN module
You will be prompted to save then file first. after saving it will be executed by ide and you can see the output in Python shell window. depending on your code you can control the GPIO pins of Raspberry pi, excess the internet for IoT application and much more.
As you can see here my code is actually creating the GUI using Python.
Now you can run this script by clicking on it or may just enter the command in terminal.
You have programmed the Raspberry pi successfully. Explore the world with giant processing power of ARM cpu with simplicity of pin controlling with GPIOs.