// Path: photorama-raspberry-pi-webapp/src/main/java/org/onebeartoe/electronics/photorama/ConfigurationServlet.java
// public static final String CAMERA_KEY = "camera";
// 
// Path: photorama-raspberry-pi-webapp/src/main/java/org/onebeartoe/electronics/photorama/PhotoBoothServlet.java
// public static final String PHOTO_BOOTH_GPIO_CONTROLLER_KEY = "PHOTO_BOOTH_GPIO_CONTROLLER_KEY";


import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.PinPullResistance;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;
import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent;
import com.pi4j.io.gpio.event.GpioPinListenerDigital;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import static org.onebeartoe.electronics.photorama.ConfigurationServlet.CAMERA_KEY;
import static org.onebeartoe.electronics.photorama.PhotoBoothServlet.PHOTO_BOOTH_GPIO_CONTROLLER_KEY;


package org.onebeartoe.electronics.photorama;


/**
 * @author Roberto Marquez
 */
@WebServlet(urlPatterns = {"/foot-pedal"})
public class FootPedalServlet extends HttpServlet implements GpioPinListenerDigital
{
    private final String PHOTO_BOOTH_FOOT_PEDAL_KEY = "PHOTO_BOOTH_FOOT_PEDAL_KEY";
    
    private volatile boolean takingSnapshot;
 
    @Override
    public void init() throws ServletException
    {
        super.init();
        
        takingSnapshot = false;
        
        ServletContext servletContext = getServletContext();

// Path: photorama-raspberry-pi-webapp/src/main/java/org/onebeartoe/electronics/photorama/ConfigurationServlet.java
// public static final String CAMERA_KEY = "camera";
// 
// Path: photorama-raspberry-pi-webapp/src/main/java/org/onebeartoe/electronics/photorama/PhotoBoothServlet.java
// public static final String PHOTO_BOOTH_GPIO_CONTROLLER_KEY = "PHOTO_BOOTH_GPIO_CONTROLLER_KEY";


// Path: photorama-raspberry-pi-webapp/src/main/java/org/onebeartoe/electronics/photorama/FootPedalServlet.java
import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.PinPullResistance;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;
import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent;
import com.pi4j.io.gpio.event.GpioPinListenerDigital;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import static org.onebeartoe.electronics.photorama.ConfigurationServlet.CAMERA_KEY;
import static org.onebeartoe.electronics.photorama.PhotoBoothServlet.PHOTO_BOOTH_GPIO_CONTROLLER_KEY;


package org.onebeartoe.electronics.photorama;


/**
 * @author Roberto Marquez
 */
@WebServlet(urlPatterns = {"/foot-pedal"})
public class FootPedalServlet extends HttpServlet implements GpioPinListenerDigital
{
    private final String PHOTO_BOOTH_FOOT_PEDAL_KEY = "PHOTO_BOOTH_FOOT_PEDAL_KEY";
    
    private volatile boolean takingSnapshot;
 
    @Override
    public void init() throws ServletException
    {
        super.init();
        
        takingSnapshot = false;
        
        ServletContext servletContext = getServletContext();

        GpioController gpio = (GpioController) servletContext.getAttribute(PHOTO_BOOTH_GPIO_CONTROLLER_KEY);
