I'm trying to make a video on a webpage change by clicking on a physical button. The button is connected to an Arduino and I can get information from it with Johnny Five, yet I'm not able to make that button press switch between 2 video's on the webpage to automatically display and play. I want to make this happen with either Java, Johnny-Five or in the Arduino IDE. Can anyone help me with this?
The code I used to blink a led with a button press, through Johnny-Five:
var five = require('johnny-five');
var board = new five.Board();
board.on('ready', function() {
var btn = new five.Button(2); // pin 5
board.repl.inject({
button: btn
});
btn.on("down", function() {
console.log("pressed button");
});
});