Jump to content

button - led help


ssp
 Share

Recommended Posts

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
Link to comment
Share on other sites

i found this thread earlier

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

Link to comment
Share on other sites

  • 7 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...