Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses
  • Cybersecurity: Radio Basics

Cybersecurity: Radio Basics

Try This: Changing Frequencies

Changing frequencies is a common practice for aircraft and watercraft radio operators.  As airplanes near certain airports, their pilots will switch their radio frequencies to communicate on the airport’s channel.  The same applies to ships which use certain radio channels when communicating offshore and other channels when in certain ports.

The send_radio_test_message script can be modified to send different messages on different channels.  Then, the receiver micro:bit will then display only the messages that go to whatever channel it’s set to.    

  • Set the project name to send_radio_test_message_try_this.
  • Make the changes to send_radio_test_message as shown below. Lines that have been added or changed are marked with comments.
  • Click Save, and then click Send to micro:bit.
# send_radio_test_message_try_this      # change

from microbit import *
import radio

radio.on()

sleep(1000)

print("micro:bit radio sender")

while True:
    radio.config(channel = 7)           # move to here
    message = "Hello from channel 7!"   # change
    print("Send: ", message)
    radio.send(message)

    sleep(1000)                         # add

    radio.config(channel = 14)          # add
    message = "Hello from channel 14!"  # add
    print("Send: ", message)            # add
    radio.send(message)                 # add
    
    print("Done!")
    sleep(1000)                         # change
  • Verify that the serial monitor messages from the sender micro:bit resemble this:

  • Check the serial monitor messages from the micro:bit that’s running the receive_radio_test_message script.  
  • Verify that the content resembles this:

  • Open and find this line in the receive_radio_test_message script:
radio.config(channel = 7)
  • Change it to this:
radio.config(channel = 14)
  • Change the project name to receive_radio_test_message_try_this.
  • Save the project.
  • Connect to the receiver micro:bit and flash the modified script.
  • Verify that its terminal output now resembles this:

 


Printer-friendly version
Receive Radio Messages
Prev
Your Turn: Receive from Both Channels
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2025 Parallax Learn • Built with GeneratePress