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

Bidirectional Texts

With unidirectional RF text working, the next step is bidirectional texting. Each micro:bit transceiver (transmitter/receiver) will take input that you type into its terminal and send it through the radio.  Each micro:bit will also receive radio messages and print them to the terminal.

 

IMPORTANT: The Send: prompt will not appear until you click inside the terminal and start typing.

 

Example script: terminal_chat_through_microbits

  • If you are in a classroom, pair off and use your assigned channel.
  • Enter, save, and flash the program below into the first micro:bit module (Transceiver A).
  • Update the first print statement,  changing  print(“micro:bit transceiver A”)  to print(“micro:bit transceiver B”).
  • Flash the script into the second micro:bit module (Transceiver B).
  • Have fun typing messages to each other!
# terminal_chat_through_microbits
# learn.parallax.com/cyberbot
# Copyright Parallax Inc 2020 under MIT license

from microbit import *
import radio

radio.on()
radio.config(channel=7)

sleep(1000)

print("micro:bit transceiver A")

print("Type messages, press enter to send.")
print("Received messages will also be displayed.")

while True:
    if uart.any():
        tx = input("Send: ")
        radio.send(tx)
    message = radio.receive()
    if message is not None:
        print("Receive: ", message)

 

Transceiver A

 

Transceiver B

 


Printer-friendly version
Unidirectional Texts
Prev
How Texting Works
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn • Built with GeneratePress