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

Inverted-Mode for Chinch #1

Closed
pascaltippelt opened this issue Sep 28, 2015 · 3 comments
Closed

Inverted-Mode for Chinch #1

pascaltippelt opened this issue Sep 28, 2015 · 3 comments

Comments

@pascaltippelt
Copy link

Some old Philips Hifi-Systems have an RC5 Chinch port. This uses, as far as I understand it, the same protocoll but inverted. Could you please add an inverted mode? You will also have to change the pin config from "INPUT_PULLUP" to "INPUT", as the Chinch works as Input and Output an a pulled up signal would overwrite everything.

@guyc
Copy link
Owner

guyc commented Sep 29, 2015

To simply invert the signal you could make a tiny change here:
https://github.com/guyc/RC5/blob/master/RC5.cpp#L137

this->decodePulse(value, elapsed);

to

this->decodePulse(!value, elapsed);

However you'll note from the comments that the input value read from the IR receiver is already inverted, and compensated for, so you may not need to invert the signal at all. Do you have any documentation for the Chinch port?

@pascaltippelt
Copy link
Author

The only "documentation" I have is the information that the RC5-Chinch port is the inverted signal of what you get from an infrared reciver and works at 5V logic.

I testet your library and the first thing I noticed was, that the input must not be used as PULLUP, as it blocks the RC5 port, because it is used in both directions. I'll try your code this evening.

Thank you!

@pascaltippelt
Copy link
Author

Okay, that's the way it works! Just (re)invert the signal as @guyc described and use
pinMode(pin, INPUT);
and it works perfectly out of the box!

@guyc guyc closed this as completed Aug 14, 2016
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

No branches or pull requests

2 participants