Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IR long press support. #95

Closed
wants to merge 4 commits into from

Conversation

exislow
Copy link

@exislow exislow commented Nov 29, 2021

To be able to adjust, e.g. volume more convenient remote button long press is now supported. If you press, for instance, UP for a long time, the volume will rise until you release the button on the IR.

Also code refactoring for aurora.ino was done to be able to maintaine and read the code better.

#define APPLE_REMOTE_MENU 0x77E14047
#define APPLE_REMOTE_PLAY_DOWN 0x77E17A47
#define APPLE_REMOTE_PLAY_UP 0x77E12047
#define APPLE_REMOTE_UP 0x77E1D055
Copy link
Contributor

@zas zas Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/brackendawson/Appleceiver/blob/357a0a16013d9e35f1119530399aba55b7030bab/Appleceiver.ino#L43-L55 suggests it should be possible to support multiple Apple remotes using correct bit mask.

EDIT: I checked both codes for APPLE_REMOTE_UP, the old one and the one you set here, the mask trick works:

For v being 0x77E1D055 (new code) or 0x77E1D047 (old code):

(v & 0x00007F00) >> 8 = 0x50

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree. But I would like to open another PR for this.

@zas
Copy link
Contributor

zas commented Nov 29, 2021

@exislow you have to base your PR on develop branch I think

@dspverden
Copy link
Collaborator

dspverden commented Nov 30, 2021

Instead of changing the source code with logic expressions I would rather prefer to see the codes read from a config file, this will enable other IR remotes then Apple only.

@zas
Copy link
Contributor

zas commented Nov 30, 2021

Instead of changing the source code with logic expressions I would rather prefer to see the codes read from a config file, this will enable other IR remotes then Apple only.

I open the path to that in #97

Basically read IR value is passed to a function which returns a code for the button pressed, we can extend it to match more remotes more easily.
It supports repeat too.
Please comment on the PR itself

@zas
Copy link
Contributor

zas commented Nov 30, 2021

@exislow can you test if #97 works for you?

@zas
Copy link
Contributor

zas commented Dec 2, 2021

@exislow if you're ok, I think we can close this PR, as #97 includes this feature.

@exislow
Copy link
Author

exislow commented Dec 2, 2021

Sure.

But a proper code style refactoring should be done for sure.

@exislow exislow closed this Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants