Finally we got the button to work on lilypad. The problem was that the LED was on initially and once the button was pressed the LED would turn off. We wanted the LED off initially and the button to turn it on. We had to declare a “switchPin” which is our button and set its digitalWrite to high. Now in the loop if the smoking variable was high and the button was pressed the LED would be off and you would be smoking, however if the smoking variable was low and the button was pressed again then the LED would be on and you would not be smoking.
Provided is a Youtube video to demonstrate the button:
Also attached are the code and argiblocks photos of the button;
Next we will be connecting a light sensor to the program and collect values and set time intervals to collect and store data.