Design and Testing

The PiMessage app was designed as a standard texting app for the PiWatch. It was designed with a two screen layout: the main screen and a text selection screen. The main screen included a large box outlined in yellow, which was where the user's message was written out, and three buttons. The clear button cleared the entire message that had been typed thus far. The send button would send the typed out message to one of the project group member's phones directly. The text button would direct the user to the text selection screen, which featured 15 preselected phrases for the user to pick between and a back button to send the user back to the main screen.

Two functions were defined to help run the PiMessage app: draw_pimsg() and pimsg_press(). The purpose of draw_pimsg() was simply to draw the three buttons (clear, text, send) on the main screen, the rectangle indicating where the user's message will be displayed, and the preselected messages and back button on the text selection page. A global variable representing the user's message was also drawn on the screen within the rectangular frame. In the function pimsg_press(), which was called when a user touch on the screen was detected, the x and y coordinates of the press were checked to see if one of the buttons on the main screen had been pushed. If a press to 'clear' was detected, then the global string variable representing the user's message was set to an empty string. If 'text' was pressed, then the user was transitioned to the text selection screen. From this screen, if a push on any of the messages were detected, this message was appended to the global string message variable. A press to the 'back' button would direct the user back to the main menu, where his/her typed out message was displayed. A press to the 'send' button would send the message, using a Twilio account set up for the PiWatch in order to take advantage of Twilio's Python library. Due to the limited capabilities of the free subscription account to Twilio, messages could only be sent to one number. Given the time limit for the project, receiving messages from another number to the PiWatch was not implemented.

Testing was performed by verifying all touch event detection on the Pi desktop before then testing the app on the piTFT by sending texts and confirming they were received by the other party (see Figure 4 ).


Results

Figure 1 and Figure 2 show screenshots of the PiMessage app's main menu and text selection menu, respectively. Figure 3 shows an example of a message displayed on the main menu after a user has got to the text selection menu, pushed one of the messages, and pushed the back button to view the results. Figure 4 shows a screenshot of an iPhone receiving messages from the PiWatch (which was given a phone number with the free trial Twilio account). Note that, though the messages displayed are only one preselected message long, the user is allowed to select as many of the messages per text as desired (they would then just be concatenated in order of selection).

Figure 1: PiMessage app, main menu.

Figure 2: PiMessage app, text selection menu (featuring all 15 preselected messages).

Figure 3: PiMessage app, with message typed out by user.

Figure 4: Screenshot of messages received from PiWatch.