I’m new to Arduino so bare with me.
I’ve been following this tutorial, http://arduino.cc/en/Tutorial/ShftOut11 to get a shift register to count up to 255 using a series of LEDs and it works fine.
However I’m trying to control the value that is getting passed to the data pin.
var arduino = new IOBoard(“172.16.3.36”, 8887);
var led;
// listen for the IOBoard READY event which indicates the IOBoard
// is ready to send and receive data
arduino.addEventListener(IOBoardEvent.READY, onReady);
function onReady(event) {
// remove the event listener because it is no longer needed
arduino.removeEventListener(IOBoardEvent.READY, onReady);
arduino.setDigitalPinMode(11, Pin.PWM);
led = arduino.getDigitalPin(11);
// use jQuery to get a reference to the buttons
// and listen for click events
$(‘#start-value-btn’).on(‘click’, turnLedOn);
$(‘#reset-value-btn’).on(‘click’, turnLedOff);
}
var turnLedOn = function (evt) {
led.value = $(‘#numberbox’).val();
};
What I would like to know is why this isn’t working? The sequence of the lights stay the same no matter what you enter. Is this even possible doing it this way?
If it is not possible, is it possible to call a custom function written in the firmata sketch from the javascript which can do this?
Thank you in advance