How to use external interrupts at the raspberry pi

1 visualizzazione (ultimi 30 giorni)
Hi,
First of all, i am apologise for my english. :)
I try to realize balance bot throught the simulink. I am using Raspberry Pi support package from simulink. I need for read from incremental sensors which is at DC motors, but GPIO READ is too slow. From specific frequencies simulink canot catch signal. I need that signal for identify speed or position of balance bot. I think and i know. There is solution made Sfunction using C++ program. But i dont know how.I have C++ which can read with externa interrupts.Have anybody solution?
  5 Commenti
Petr Mamula
Petr Mamula il 8 Feb 2021
Hi,
Yes, there is one sulution, but it is a little bit tricky, but it work very well for me!
I bought ESP8266. Every pin of this MCU are an interrupt pin. I programed code for external interrupt.
For transfer data from ESP to Rpi i am using UART. Its easy to implement. Rpi sent any number to ESP, and after that ESP sent increment of pulses. I set the sampling time to 0.01s. With that knowlage you can calculate true velocity and position. There is not problem with bouncig or miss read. ESP have not problem with two motors--> 4 input signals.
I dont used any libraries.
I know, this is not what you want to read, but as i said, it wok!
Maximal frequency of interrupt is 1,2kHz.
Aditya Patil
Aditya Patil il 1 Apr 2021
Hi Petr, feel free to post your solution as an answer, so that it helps others in the future

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Raspberry Pi Hardware in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by