Tue Mar 21 10:44:28 EST 2023
 

Date Created: 2013-12-09 06:18:24 -0600 (Mon, 09 Dec 2013)

Photorama LCD with Keypad Kit Edition

Introduction

This guide shows how to setup and use the LCD with keypad edition of onebeartoe Photorama, for Raspberry Pi. The application is run from the command line. A menu system is displayed on the LCD. The keypad is used to navigate the menu system.

Under the hood, the application uses Java to communicate with the LCD and keypad using I2C. The Raspberry Pi camera is controlled with system calls to raspistill.


Required Materials

This project assumes you have access to a working Raspberry Pi with camera module.

This project also requires an LCD with keypad kit from Adafruit.


Hardware Assembly

Raspberry Pi with Camera

Use this Rasperry Pi and camera module quick start guide to get familiar with the hardware.

LCD with Keypad Kit

Adafruit has a great https://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-raspberry-pi. Follow those instructions and pick up here, once it is working on the Raspberry Pi.

raspbery pi with camera setup
Here is what the setup could look like once assembled.

Software Prerequisites and Installation

JRE

This project requires Java 8. Fortunately, the latest release of Raspbian comes with a suitable JRE (Java Runtime Environment) for this project.

If the latest version of Java is not installe don the Raspberry Pi, then use the following commands to obtain it.

        sudo apt-get update
        sudo apt-get upgrade
        sudo apt-get install oracle-java8-jdk
        

Java Application

This project is written in Java and is deployed as an executable JAR. It is run from the command line.

Download the Application

Copy the JAR to the Raspberry Pi and cd to the directory where the JAR was copied.


Software Usage

Running the App

Run the application by issuing the following command, in the same directory where the JAR file was copied. This will bring up the top level menu for the application, on the LCD.


Modes

This LCD with keypad version of Photorama features snapshot and time lapse modes.

The up, left, right, and select keys are used to move between modes, and to start and stop the individual modes.

In snapshot mode, the select button is used to take a single snapshot. In time lapse mode, selecting Minute, Second, or Hour starts the time lapse at the current frequency. The snapshot frequency is adjusted with the left and right keys.

The up key is used to 'go up' a level in the menu system.

Video Demonstration


Resources

Source Code and Build Server

The source is available on Github:
https://github.com/onebeartoe/photorama/tree/master/photorama-raspberry-pi-lcd-keypad

Development builds are available on Cloudbees: https://onebeartoe.ci.cloudbees.com/job/photorama/

State Diagram

Here is the state diagram used to build the menu system.


Going Further

Desktop Edition

While working on this version of the Photorama, I did not always have access to a Raspberry Pi. The model, view, control pattern was used to separate the application logic from the user interface. A separate desktop (Javafx) application was created to allow working on the menu system logic, when a Raspberry Pi was not on hand.

As a result, there is a matching application with a graphical user interface (GUI). It currently uses a mock (do nothing) camera implementation. With a little work, the GUI app can be modified to function with a USB camera on PC or laptop operating systems. This is an exercise left for the reader.



Date Created: 2013-12-09 06:18:24 -0600 (Mon, 09 Dec 2013)