Mina Schepmann
Published

Morse Code Decode

Ever wanted to learn Morse Code but never knew how to start? Try out this fun game as a catalyst for your cryptographical adventure!

BeginnerWork in progress1 hour234
Morse Code Decode

Things used in this project

Story

Read more

Schematics

Morse Code Decode Circuit Diagram

Wiring Schematics for the Device!

Code

Configure Pins

Python
This is the file which will set the pins on your PocketBeagle as the desired pin type.
#!/bin/bash
# --------------------------------------------------------------------------
# Combination Lock - Configure Pins
# --------------------------------------------------------------------------
# License:   
# Copyright 2024 Mina Schepmann
# 
# Redistribution and use in source and binary forms, with or without 
# modification, are permitted provided that the following conditions are met:
# 
# 1. Redistributions of source code must retain the above copyright notice, this 
# list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright notice, 
# this list of conditions and the following disclaimer in the documentation 
# and/or other materials provided with the distribution.
# 
# 3. Neither the name of the copyright holder nor the names of its contributors 
# may be used to endorse or promote products derived from this software without 
# specific prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# --------------------------------------------------------------------------
# 
# Configure pins for Combination Lock:
#   - I2C1
#   - Joystick
#   - LEDs (Red / Green)
#   - Buzzer
#   - SPI Screen
# 
# --------------------------------------------------------------------------

# I2C1
config-pin P2_09 i2c
config-pin P2_11 i2c

# LEDs
config-pin P2_04 gpio
config-pin P2_06 gpio

# SPI
config-pin P1_06 gpio
config-pin P1_04 gpio
config-pin P1_02 gpio
config-pin P1_10 miso
config-pin P1_12 mosi
config-pin P1_08 clk

# Buzzer
config-pin P2_01 pwm

# Joystick
config-pin P2_19 gpio
config-pin P1_19 pwm
config-pin P1_21 pwm

Run File

Python
This is the code that will initialize the code on power up of the device.
#!/bin/bash
# --------------------------------------------------------------------------
# Morse Decode Game - Run Script
# --------------------------------------------------------------------------
# License:   
# Copyright 2024 Mina Schepmann
# 
# Redistribution and use in source and binary forms, with or without 
# modification, are permitted provided that the following conditions are met:
# 
# 1. Redistributions of source code must retain the above copyright notice, this 
# list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright notice, 
# this list of conditions and the following disclaimer in the documentation 
# and/or other materials provided with the distribution.
# 
# 3. Neither the name of the copyright holder nor the names of its contributors 
# may be used to endorse or promote products derived from this software without 
# specific prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# --------------------------------------------------------------------------
# 
# Run Combination Lock in /var/lib/cloud9/ENGI301/project_1/game
# 
# --------------------------------------------------------------------------

cd /var/lib/cloud9/ENGI301/project_1/game

./configure_pins.sh

dirs=(
    '/var/lib/cloud9/ENGI301/python/ht16k33:'
    '/var/lib/cloud9/ENGI301/python/button:'
    '/var/lib/cloud9/ENGI301/python/led:'
    '/var/lib/cloud9/ENGI301/python/potentiometer:'
    '/var/lib/cloud9/ENGI301/python/buzzer:'
    '/var/lib/cloud9/ENGI301/python/button:'
    '/var/lib/cloud9/ENGI301/python/SPI:'
)

PYTHONPATH=$(IFS=; echo "${dirs[*]}") python3 game.py

Morse Code Decode GitHub Repository

Use this link to access the repository which stores the code that runs the Morse Code Decode Game!

Credits

Mina Schepmann

Mina Schepmann

1 project • 0 followers

Comments