How to use external interrupts at the raspberry pi

1 Ansicht (letzte 30 Tage)
Petr Mamula
Petr Mamula am 27 Nov. 2020
Kommentiert: Aditya Patil am 1 Apr. 2021
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 Kommentare
Petr Mamula
Petr Mamula am 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 am 1 Apr. 2021
Hi Petr, feel free to post your solution as an answer, so that it helps others in the future

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Raspberry Pi Hardware finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by