Using a Shift Register with Breakout
- This topic has 2 replies, 2 voices, and was last updated 10 years, 11 months ago by theutherfish.
-
AuthorPosts
-
April 25, 2012 at 3:07 PM #638theutherfishParticipant
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
April 25, 2012 at 10:42 PM #643soundanalogousMemberShiftIn and ShiftOut are not currently supported by StandardFirmata. There is a proposal to add that functionality but it may not be for a few more months.
There is another way to use Breakout in which you write your own firmware for the Arduino rather than using StandardFirmata. This way you can send any type of data between the Arduino board and your browser. At this point I don’t have a tutorial on writing custom firmware for Breakout, but there are a couple of examples. Refer to Breakout/custom_examples. I hope to post a tutorial soon though.
April 26, 2012 at 6:50 AM #644theutherfishParticipantI’m looking forward to seeing those functions available soon, obviously this is done in the dev’s free time so it might take some time.
The custom examples look like a good starting point.
Thank you again
-
AuthorPosts
- The forum ‘Forum’ is closed to new topics and replies.
