Lab 2
Lab 2
Pre-requisite: Raspbian OS
Part 1: Digital output in Raspberry
Theory Concepts:
The raspberry Pi is a SoC that can be used to generate a lot of systems. For that
reason, is important to understand its working and learn how to handle de Inputs
and outputs of this system.
Raspberry pi will require a screen to visualize all the work done. In this laboratory
we will learn how to use our laptops as raspberry monitor and work using VNC
communication protocol.
VNC Installation:
What is VNC?
Virtual Network Computing is a graphical desktop-sharing system used to control
remotely computers. This system will allow users to visualize the graphic interface
of a specific system from another source.
• To use VNC viewer we Will need to know the user, password and ip from
our raspberry pi.
• We can change the password using the passwd command in terminal or
in raspberry pi preferences.
We will select VNC complement, put the ip from the raspberry, the user, and the
password.
As an alternative, VNC Viewer can be used in Ubuntu. It is an easy use software
that will provide similar features to Remmina without too much configuration.
To install VNC Viewer you can follow the next link:
https://www.realvnc.com/en/connect/download/viewer/linux/?lai_sr=10-
14&lai_sl=l
Or alternatively you can download it in your Ubuntu OS using the Ubuntu store.
SSH Communication:
# Pin definitions
led_pin = 12
# Suppress warnings
GPIO.setwarnings(False)
# Blink forever
while True:
GPIO.output(led_pin, GPIO.HIGH) # Turn LED on
time.sleep(1) # Delay for 1 second
GPIO.output(led_pin, GPIO.LOW) # Turn LED off
time.sleep(1) # Delay for 1 second