package lab1;

import c4e.phidget.HardwareInterface;

public class Blink extends HardwareInterface
{
	//------------------------------------Attribute Section
	private int pinNumber;
	private boolean pinState;
	private long timerDelay;
	
	//------------------------------------Constructor Section
	public Blink(boolean debug)
	{
		super(debug);
		this.pinNumber = 1;
		this.pinState = true;
		this.timerDelay = 1500;
		this.setTimer(this.timerDelay);
	}

	//------------------------------------Behaviour Section
	@Override
	public void timerCallback()
	{
		System.out.println("My timer woke up!");
		this.setOutputState(this.pinNumber, this.pinState);
		this.pinState = !this.pinState;
		this.setTimer(this.timerDelay);
	}
	
}
