IR-Remote | Simple Android IR-Remote for my Samsung TV and Soundbar | Android library
kandi X-RAY | IR-Remote Summary
kandi X-RAY | IR-Remote Summary
Simple Android IR-Remote for my Samsung TV and Soundbar
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create new instance
- Convert the hex string to IR command
IR-Remote Key Features
IR-Remote Examples and Code Snippets
Community Discussions
Trending Discussions on IR-Remote
QUESTION
By default, the options in /etc/lirc/lirc_options.conf are as follows:
...ANSWER
Answered 2020-Jun-30 at 08:01They are not the same. The devinput driver uses the kernel decoder, and feeds these decoded events to the lircd fifo. This fifo is what clients read from.
The default driver reads raw timing data from the kernel and makes it's own decoding using lircd.conf.
In general, if the devinput driver works it could safely be used and is a simpler setup. The default driver is useful in contexts where the kernel decoding doesn't work for example when a remote isn't supported by the kernel or there is a need to send (blast) ir signals -- the latter cannot be done using the devinput driver.
More info: https://www.lirc.org/html/configuration-guide.html
There is no way to dump the options as such. However, by setting the loglevel to debug and inspect the logs using for example journalctl the values are visible.
EDIT: /dev/lirc0 and friends provides the raw, unencoded data from the kernel. The devinput driver reads from a /dev/input/eventXX device. In both cases 'auto' make lircd to use the first found usable device which works as long as there is only one remote connected.
QUESTION
I posted this Question on arduino.stackexchange, but i think this Question has to do (maybe) only with the language (C).
I have a car and I'm trying somehow to power OFF the car when a song plays using Arduino, with Infrared (IR) Remote. I decided to play a song (SuperMario) using a Buzzer and when I press the Power ON button works fine and the song plays.
The problem is when I press Power OFF, I have to wait until the song ends to Power off the car.
I was thinking that maybe I need threads or something, but I'm not sure, or maybe there is a better way to fix this.
Here is a Demo program:
...ANSWER
Answered 2017-Jun-13 at 19:04I'm not going to rewrite your program to make it multi-threaded as that's behind the scope of answering a specific question. I can give you a description of what's required though as a starting point.
First of all, a simpler way to fix this without threads would be to use something like signals to stop the playing of the tune. This is what happens when you press Ctrl-C. Your program is reading input from your IR though, so as far as I can tell using threads looks necessary to both reading IR input and playing of sound happen at the same time.
I'm not familiar with Arduino but I'm assuming you have something like pthreads. You would need to get familiar with that. It is not a trivial change as using threads is very different paradigm and takes time to get your head around if you haven't used them before. The main thing to get your head around is that code is executing in more than one place.
Your main thread, the beginning process before any thread is created, would be running loop()
so it can respond to any IR input. Having it in its own thread lets it respond to any user input. The problem with your code right is that it must wait for the playing of the tune in playSuperMario()
to return before it can process any new input.
You would create a thread somewhere during initialization. This thread will be what plays the tune. It needs to be able to start the tune based on IR input. Also you'll need to define the behavior of things like what happens if the "ON" button is pressed while it's already playing? Does it start again, stop or is that ignored and it keeps playing?
You'll need one or more variables used by both threads. This will require mutex protection so only one thread can read/write it at a time. Let's say there's a global variable isPlaying
initially set to true
. When the off button is pressed this would be changed to false
. Your playSuperMario()
and buzz()
, etc. functions would need to check if this value is false in its loops. If false then it will return immediately.
That's a general pointer to how to handle this hope it helps.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install IR-Remote
You can use IR-Remote like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the IR-Remote component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page