This repository contains the resources needed to kick start your EGL314 journey. Have fun and all the best! YWFU
- Single Board Computer: Raspberry Pi 4 Model B
- Operating System: Raspbian Buster Full
- SSH terminal (Putty)
- SCP FIle sharing client (WinSCP)
- Microsoft Visual Studio Code
- VNC Viewer
- Local IP/Port Scanner
- Github Desktop link
graph TD;
A[Laptop]-->B[VNC Viewer]
B-->A
A-->C[Putty-SSH / WinSCP - SCP]
C-->A
C-->D[Network Router]
D-->E[Raspberry Pi]
F[Keyboard / Mouse]-->E
E-->G[HDMI Monitor]
- Secure Shell (SSH) into Raspberry Pi using Putty.
Hostname: pi@ip_address
Port: 22
Password: (student_defined)
- Once logged in, update the Raspberry Pi
sudo apt update
sudo apt upgrade
If update and upgrade is unsuccessful, try the following. Manually Set time, then update and upgrade Raspberry Pi again.
sudo date -s 'YYYY-MM-DD HH:MM:SS'
SSH is a network communication protocol that enables two computers to communicate and share data.
To enable SSH, type the following
sudo raspi-config
Select 3 Interface Options
Select P2 SSH
Enable SSH
VNC is a cross-platform screen sharing system that can be used to remotely control another computer.
To enable VNC, type the following
sudo raspi-config
Select 3 Interface Options
Select P3 VNC
Select Enable VNC
By default, VNC Viewer will not work on a raspberry pi without any active HDMI connection onto a monitor. We can enable hdmi_force_hotplug to force a HDMI signal even without any active HDMI connection!
To enable hdmi_force_hotplug, type the following
sudo nano /boot/config.txt
Scroll to the bottom of the file and paste
hdmi_force_hotplug=1
hdmi_group=2 # HDMI display group
hdmi_mode=82 # 1900 x 1080 resolution
Save and exit the nano file editor
crtl + o
to write(save) the file
crtl + x
to exit the editor
This step prevents the display output from going to sleep (blank) from inactivities.
To disable Screen Blanking, type the following
sudo raspi-config
Select 2 Display Options
Select 04 Screen Blanking
Select Disable Screen Blanking
The recommended method to configure the Raspberry Pi with a static IP address would be the following:
- Identify the MAC address of Raspberry Pi through network router.
- Configure DHCP Reservation through network router.
- Restart DHCP services on Raspberry Pi to update IP configuration.
- For Raspbian Bookworm
sudo systemctl restart NetworkManager (for Raspbian Bookworm)
sudo systemctl restart dhcpcd (for Raspbian Bullseye and below)
This section will provide a series of mini-tutorials to help you get familiarze with Tkinter. Do note that that this section only cover the fundamental features of TKinter. Refer to https://www.tutorialspoint.com/python/python_gui_programming.htm for a more extensive list.
To make the best of use of this section, please attempt the tutorial questions. If and only if you are stuck, refer to the tutorial sample for guidance.
Create a GUI windows that consist of 3 buttons that will print out the following when pressed
Button Pressed is RED
- RED BUTTONButton Pressed is BLUE
- BLUE BUTTONButton Pressed is GREEN
- GREEN BUTTON
Below is a sample of how the GUI will look like.
Set the respective R,G,B buttons to dehalfault Red, Green and Blue colours respectively. Then integrate a colour scale (minimally 5 colours) for users to "customize" colour choices for the button.
Below is a sample of how the GUI will look like.
Build a GUI to allow users to input a set of string
- cat
- dog
- beach A photo preview window will apear when import button is pressed
- You can attempt to install the Python Image Processing (PILLOW) library.
- You might require the Python OS module.
Below is a sample of how the GUI will look like.
The program will output 3 sample previews (you can find these images in ~/EGL314starterkit/images/
)
For your final challenge, each group will develop and build a GUI with the following features.
- 3 x 3 grid that allows users to change colour values.
- A colour scale for users to select 8 different greyscaled colours.
- 4 presets that change grid to All White, All Black, X Pattern and Sequence.
- A enter button to send a 3 x 3 array value.
- You can explore Python List (or rather...List of List) to build the 3x3 grid of buttons.
- To create a function to identify which button was pressed