Jump to content


Photo

button - led help


  • Please log in to reply
4 replies to this topic

#1 ssp

ssp

    MIDIbox Tweaker

  • Programmer
  • PipPipPip
  • 419 posts

Posted 19 February 2010 - 13:05

i solved the initial issue earlier today and now the leds i need to light up, light up. however unless the button is in toggle mode the buttons do not stay on.

what i need is for a button which is not a toggle to have its light stay on until another button is pressed and then the new led comes on and the old led switches off. is this possible? and how

thanks

Edited by ssp, 19 February 2010 - 21:43.


#2 ssp

ssp

    MIDIbox Tweaker

  • Programmer
  • PipPipPip
  • 419 posts

Posted 19 February 2010 - 15:10

i have tried several things to solve this issue now and i still cannot get the lights to stay on until the next button press.

Edited by ssp, 19 February 2010 - 21:44.


#3 ssp

ssp

    MIDIbox Tweaker

  • Programmer
  • PipPipPip
  • 419 posts

Posted 19 February 2010 - 21:56

i found this thread earlier http://midibox.org/f...dpost__p__88556

would this do what i want? and how would i implelent it into my current setting

dout sr1 pins 1-8 are assigned to dinx4 sr8 button 54-64

#4 Bassman

Bassman

    MIDIbox Newbie

  • Members
  • Pip
  • 57 posts
  • LocationLondon, UK

Posted 19 February 2010 - 23:39

i found this thread earlier http://midibox.org/f...dpost__p__88556

would this do what i want? and how would i implelent it into my current setting

dout sr1 pins 1-8 are assigned to dinx4 sr8 button 54-64


I don't know what application you are using, but this is the way I did it in the MB64.

In the file mb64_buttons.inc, around line 237, I changed the routine to this.

MB64_BUTTON_OnOnly
	;; when on: send button value defined in dump
	;; when off: send nothing
	BRA_IFSET TMP1, 0, ACCESS, MB64_BUTTON_NotifyChangeEnd
	;; turn off SR4 8 LEDs
    SET_BSR MB64_BUTTON_VALUES_SR0+3 
    setf MB64_BUTTON_VALUES_SR0+3
	;; save status of button
	rcall	MB64_BUTTON_Hlp_SaveStat
	rgoto	MB64_BUTTON_Send

The shift registers that you want to affect is determined by the two lines, I wanted to use sr4.
SET_BSR MB64_BUTTON_VALUES_SR0+3 
    setf MB64_BUTTON_VALUES_SR0+3

So in your case you want to affect sr1, so the two lines would look like this
SET_BSR MB64_BUTTON_VALUES_SR0+0 
    setf MB64_BUTTON_VALUES_SR0+0

You can affect more than 1 shift register, by adding the two lines again, for every shift register you want to affect.
For example;
SET_BSR MB64_BUTTON_VALUES_SR0+0 
    setf MB64_BUTTON_VALUES_SR0+0
    SET_BSR MB64_BUTTON_VALUES_SR0+1 
    setf MB64_BUTTON_VALUES_SR0+1
    SET_BSR MB64_BUTTON_VALUES_SR0+2 
    setf MB64_BUTTON_VALUES_SR0+2
    SET_BSR MB64_BUTTON_VALUES_SR0+3 
    setf MB64_BUTTON_VALUES_SR0+3

That would do all 4 shift registers.

Bassman

#5 besh

besh

    MIDIbox Newbie

  • Members
  • Pip
  • 16 posts

Posted 09 October 2010 - 15:47

Is it possible to split this over two regions.
So maybe shift register 0 and 1 change leds by button press
and separately from this shift register 2 and 3?
How to change the code for that?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users