This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
rf remote
#6
(2019-08-08, 08:00 PM)seandepagnier Wrote: I'm not sure about pressing buttons together.   I am implementing rf receiver eventually so  I will  play with it.   The raspberry turns out having difficulty decoding  these in software, a lot of cpu used  and  not all packets are decoded.  Unless maybe a kernel module could help this.

For now I found an arduino is better to offload this  task.   This means it would be relatively  easy to also make custom remotes with more  than 4  buttons, so dodge buttons are possible, and sending different messages for releasing  the buttons to make  holding  them down work better.

Sean
I used to do embedded software a long time ago.
New hardware is much more powerful but with an os to deal with make some options more complicated.
I used to write my own scheduler and interrupt handling as there was no os.
If there was an os it was msdos that is worthless so just took over everything.

I have a few ideas on how to attack it.
Not sure what they have in python.

Hopefully they have ques and semaphores or some sort of multi threading tools in python.

Maybe this will work:
If possible arrange inputs so they are in one byte.
Run an independent process that does the following:

Read inputs.
If necessary pack into one byte and mask unneeded bits.
Store in a que
sleep  I'd do .05 seconds as first try ( as long as sleep period is reasonably consistent it should work OK)
Back to beginning

Then in main program read from the que.

Make a simple table with the 16 possibilities.
................. editing a bit
The main loop part is too simplistic :-(
Best to activate a command when all keys return released state.
A 2 key command will likely have the keys pressed and released in arbitrary order.
What matters is seeing 2 keys pressed and activate when all go off.
If an undefined combination of keys are pressed I would just consider it an error state until all keys are released. That will give you a way to abort a command by just pressing another key before releasing.
Will need to keep track of state a little but nothing that complicated.
Can check how long a key is down by how counting how many times it was in the que.
.......................



If you need to debounce need to compare old to new and wait until old=new.

Hopefully that makes sense.
I've never had the best language skills :-(
Reply


Messages In This Thread
rf remote - by johnm - 2019-08-05, 05:10 PM
RE: rf remote - by svkatielee - 2019-08-07, 11:36 PM
RE: rf remote - by seandepagnier - 2019-08-08, 08:00 PM
RE: rf remote - by Jlsail - 2019-08-15, 04:51 PM
RE: rf remote - by johnm - 2019-09-10, 08:07 PM
RE: rf remote - by seandepagnier - 2019-08-15, 11:41 PM
RE: rf remote - by quetzal - 2019-09-27, 09:41 PM
RE: rf remote - by abarrow - 2019-09-28, 07:29 PM
RE: rf remote - by quetzal - 2019-09-30, 10:25 AM
RE: rf remote - by dsanduril - 2019-12-04, 11:45 PM
RE: rf remote - by seandepagnier - 2019-12-07, 03:06 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)