How to use external interrupts at the raspberry pi

1 回表示 (過去 30 日間)
Petr Mamula
Petr Mamula 2020 年 11 月 27 日
コメント済み: Aditya Patil 2021 年 4 月 1 日
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 件のコメント
Petr Mamula
Petr Mamula 2021 年 2 月 8 日
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 2021 年 4 月 1 日
Hi Petr, feel free to post your solution as an answer, so that it helps others in the future

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeRaspberry Pi Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by