The SPS HC20 - droid edition is an Android app that controls the SPS HC20 scoreboard by means of the custom-made, Arduino-based interface described in "Controllo di un tabellone segnapunti con Arduino" (italian only). It is a porting of the consolle.py application included in the SPS HC20 Suite.
The SPS HC20 - droid edition can be used on any Android terminal with USB-OTG support or as a stand-alone application on devices that do not support it, given that it won't be able to communicate with the interface circuit.
Time management module. The main objects in this packages are:
ThreadedClock: sends atickto the attachedObserverevery hundredth of a second from a background thread;StopWatch: measures the time counting the ticks that receives from theThreadedClock;TimeView: determines the figures to be shown on the display;GamePeriod: defines the duration of a game period;Timer: controls the internal clock;TimerWidget: keeps the on-screen timer up to date with the internal clock.
Scoreboard management module. The main objects in this packages are:
Timer: contains time-related data;Team: contains team-related data (set, score and other flags);Data: contains the whole dataset to be shown on the scoreboard;Scoreboard: manages the communication to/from the interface circuit.
The main objects in this package are:
UsbPort: models a virtual serial port over USB;MainActivity: controls the application's UI.
The "Comunicazione seriale Arduino/Android via USB" page (italian only) describes how the UsbPort has been implemented.
The scoreboard's siren may emit a short buzz when the application connects to the interface circuit because Arduino board's autoreset feature causes the firmware to restart everytime its serial port is opened (see for example "Arduino reset after serial connection opened").
A simple work-around is to connect the scoreboard to the interface circuit when the application is already running:
- switch the Android terminal on;
- connect the Arduino board to the Android terminal with an USB OTG cable;
- Android will ask you if it should open the SPS HC20 application: choose yes;
- connect the scoreboard to the Arduino board.
A more reliable solution would be disabling the autoreset feature (see "DisablingAutoResetOnSerialConnection" for details), but it has its drawbacks: it prevents any future firmware upload.
Icons made by Freepik from www.flaticon.com.