Cyber Logo

Foundations of Cybersecurity

Lesson 3 Variable/Images.

  Micro:bit Image Using Variables with images

This Python code for the micro:bit includes images of a heart,
small heart, rock, car, money, paper, house, and plane, along with
the original boat image. Each image is defined in a 5x5 matrix
and displayed sequentially on the micro:bit.
Please code it.
from microbit import * # Original boat image boat = Image("05050:" "05050:" "05050:" "99999:" "09990") # Additional images heart = Image("09090:" "99999:" "99999:" "09990:" "00900") small_heart = Image("00000:" "09090:" "09990:" "00900:" "00000") rock = Image("00000:" "09990:" "99999:" "09990:" "00000") car = Image("00000:" "09990:" "99999:" "09090:" "09990") money = Image("09090:" "99999:" "90909:" "99999:" "09090") paper = Image("99999:" "90009:" "90009:" "90009:" "99999") house = Image("00900:" "09990:" "99999:" "90909:" "99999") plane = Image("00900:" "99999:" "00900:" "09090:" "00000") # Display the images sequentially images = [boat, heart, small_heart, rock, car, money, paper, house, plane] display.show(images, delay=1000) Click here and read this resources A. Click here and read this resources B. You will drop off 4 files into Google Classroom: • Your files will be: (Remember the python program is dropped off first.) • PX_lastname_VarImage.py (Python program) • PX_lastname_VarImage.hex (Hex file for Microbit hardware) • PX_lastname_VarImage.png (Screenshot) • PX_lastname_VarImage.mp4 (Video running the program)   Current Resources needed:      Check in and check out your Micro:Bit      Launch the Micro:Bit Python interpreter      At this time you will run your code.      Use the online Microbit but still download the hex file for hardware use.      If you do not understand this assignment,      ask Mr. Cusack and/or attend tutorials.

Additional Resources

Cyber Range Passwords (Period 1)

Cyber Range Login

Note: Use Ctrl + Shift + Alt to copy/paste between Linux virtual and Windows environments.