Once you've got the IDE installed and libraries in place you can run our test sketch. This will check all the hardware, and display it on the screen, its sort of a universal test because every part is checked. It's also a great reference if you want to know how to read the light sensor or read the buttons.

You can find it as an example in the Adafruit Arcada library (check the previous page for all the libraries you need to install!)

The test code

  1. Checks the QSPI flash chip initialised correctly, and displays the manufacturer/device ID if so
  2. Checks if the QPI flash has a filesystem on it (if not, try loading CircuitPython which will create a filesystem). It will print the # of files found in the root directory
  3. Tests if an accelerometer was found. PyBadge LC boards will fail on this test, that's OK!
  4. If there's an accelerometer, print out the X, Y, Z gravitational tuple.
  5. Display the light sensor value, which ranges from 0 (dark) to 1023 (bright)
  6. Display the detected battery voltage, from ~3.3V to 4.2V (charged). If no battery, this will float around 4.1V and is normal (there's no way to detect a battery is connected)
  7. D3/A8 and D4/A9 measure the analog voltages on the 3 pin JST connectors. They'll be floating until some voltage is applied to them, so ~0.4V is normal
  8. Draw a 'virtual' joystick for the 8 buttons on the front of the badge, when buttons are pressed

If the PyBadge accelerometer is shaked or tapped, it will play a 'coin' sound from the mini speaker. If there's no accelerometer, hold SELECT and START down together to trigger the coin sound

To test Arcada's callback functionality, we pulse pin #13 red LED so you'll see it ramp up 4 times a second.

This guide was first published on May 25, 2019. It was last updated on Feb 24, 2024.

This page (Arduino Test) was last updated on May 24, 2019.

Text editor powered by tinymce.