IR remote, Multifunction single button, How to??

I'm trying to create a multifunction button on the IR remote. but every method I try eventually become gibberish to the Arduino... Here's what I want..

Press ST/REPT,
Adjust Red RGB brightness using Up and Down arrows.

Press ST/REPT a second time -
Adjust Green RGB brightness using Up and Down arrows.

Press ST/REPT a third time -
Adjust Blue RGB Brightness using Up and Down arrows.

Press ST/REPT a fourth time -
Revert back to Red RGB brightness adjustment,
Start cycle over each press of ST/REPT

Press "any other button"
End count of number of times ST/REPT was pressed
Revert Up and Down arrows back to adjusting all 3 RGB colors together.

I should also note that I have my LCD display hooked up, and displaying what button is being pressed, such as "ST/REPT" on (0,0) and the color brightness reference "R 255, G 200, B 150" on (0,1) ... for example. As well as adjusting all 3 RGB colors symmetrically using a DimFactor%.

I messed up my coding pretty bad and didn't save a backup. Got a few odds and ends saved that I can patch it back together. but don't have anything I can really show you right now. just hoping for some tips on how to create a multifunction button on IR remote. (I've attempted some standard wired button examples. the coding for them don't work the same way. as push buttons are "true/false" or "0/1". Can't seem to apply the same logic to
case 0xFFB04F:
break; "

Each time a new instance of ST/REPT comes in increment a counter. You may need some state change detection code for this. IDE -> file/examples/digital/...

Use the counter value to select the correct color values to change.

You may also find something useful in timer counter state change toggle FSM tutorial

Sorry to say you are not the first or last to lose a lot of work because of a lacking backup. Obviously you would be better qualified to solve this problem then we are. If nothing else save a copy on a thumb drive or a network server. For ideas try this link: How to Make One Button Have the Functionality of Two or More with Arduino - Programming Electronics Academy

So far I've managed to rebuild my original program so that I can create various colors via button selection, and dim all the RGB LED's with my up and down button, and display my button selection and color codes on my LCD. Pretty cool so far. But it would be pretty cool if I can get one button to select Red, Green or Blue to manipulate that brightness independently of the other colors.

I've set up in a separate function "void ST_REPT". BUT, I cannot seem to get my counter to reset to zero when another button is pressed. Every attempt so far results in either, button press counter won't reset to zero when another button is pressed, OR button counter remains at zero even when "ST/REPT" is pressed.
I'm trying to get the button counter to work perfectly before I attempt to add commands for what to do in case of each button count.

my code is kind of long, so I just included an attachment.

Thank you in advance for your time in helping me with this!

LCD_IR_RGB_03.ino (6.84 KB)

Within minutes after my last comment/post about not being able to get the counter to work right, I got it working perfectly by using the "myCom identifier" instead of the "cmd.value identifier". Now both my if( "==") at the beginning and my if("!=") at the end BOTH work.

Button count holds for "ST/REPT" AND resets to zero if any other button is pressed...

Now if I can figure out how to delay that pesky "button hold" so that I don't have to release it within milliseconds after pressing the button!

Wish me luck on getting the RGB LED's to change brightness independently with each button count now.

LCD_IR_RGB_03.ino (6.31 KB)

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.