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
  • The Magic BS2 Board Project

The Magic BS2 Board Project

Wire Up and Test the Board

Schematics and Building the Circuits

Figure 1 below shows the schematic for the Magic BS2 board, and Figure 2 displays the optional mounting bracket assembly for the LCD display.

Figure 1 – Magic BS2 Board Schematic

Figure 2 – Optional Mounting Bracket Assembly

Not sure how to wire circuits from schematics? No problem! Parallax offers another video tutorial on exactly that topic: How to Wire Circuits from Schematics.

 

Testing the Circuit

Once your circuit is wired, it’s a good idea to test that everything is working properly before developing code. The program below (also included in the source code download zip) displays a message on the Serial LCD and displays the states of the 4-Directional Tilt Sensor using the Debug Terminal.

Code:

' MagicBS2Board_Test.bs2
' Tests the functionality of the board

' {$STAMP BS2}
' {$PBASIC 2.5}

LCDpin    PIN    13                    ' Declare LCD pin

DEBUG CLS                              ' Clear the Debug Terminal

SEROUT LCDpin, 84, [22, 12]            ' Initialize the LCD
PAUSE 5

SEROUT LCDpin, 84, ["Testing..."]      ' Display test message

DO
  DEBUG BIN1 IN0, "  ", BIN1 IN1, CR   ' Display tilt states
  PAUSE 300                            ' at human speeds
LOOP

Another thing to check when running this code is to monitor how the 4-Directional Tilt Sensor responds when being shaken. We will need to determine what pattern emerges (if any) so that we can track when the board is moving and when it’s not, inside the code.

Figure 3 is a snippet of the tilt sensor’s states when being shaken. Notice that the state on at least one pin changes almost every time a reading is taken. But you should also notice that sometimes, the state remains the same. This will be key information as we put together our final program code!

Figure 3 – Debug Terminal Output of Tilt Sensor’s States


Printer-friendly version
Coding Some Magic
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn • Built with GeneratePress