ssp Posted February 19, 2010 Report Share Posted February 19, 2010 (edited) 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 February 19, 2010 by ssp Quote Link to comment Share on other sites More sharing options...
ssp Posted February 19, 2010 Author Report Share Posted February 19, 2010 (edited) 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 February 19, 2010 by ssp Quote Link to comment Share on other sites More sharing options...
ssp Posted February 19, 2010 Author Report Share Posted February 19, 2010 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 Quote Link to comment Share on other sites More sharing options...
Bassman Posted February 19, 2010 Report Share Posted February 19, 2010 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 Quote Link to comment Share on other sites More sharing options...
besh Posted October 9, 2010 Report Share Posted October 9, 2010 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.