Тёмный

TinyGo and Raspberry Pi Pico: GPIO and Interrupts 

Pragmatik Tech
Подписаться 347
Просмотров 1,9 тыс.
50% 1

Take a dive into how we connect peripherals like LEDs and push buttons to the GPIO pins of the Pico. Then, see how easy it is to set up an Interrupt Service Routine (ISR) that performs an action when the push button is pressed or released.
* Web site: pragmatik.tech/
* Tutorial: pragmatik.tech...
* GitHub Repo: github.com/pra...

Опубликовано:

 

16 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@iaingeddes7159
@iaingeddes7159 3 месяца назад
Fantastic series! Thanks
@nodidog
@nodidog Год назад
Just wanted to say thanks, for putting this series out. I really appreciate it!
@jyoun79
@jyoun79 2 года назад
Very cool!
@tonygilkerson
@tonygilkerson 2 года назад
This is great, I am learning how to code pico with TinoGo and there are many python examples but actual TinyGo examples are hard to find so please keep them coming. I do have a question. Is the execution of the interrupt function concurrent or parallel? For example if you were to put a sleep in your function that checks the button status would the other light pause for awhile?
@pragmatiktech
@pragmatiktech 2 года назад
Yes it would. Although time.Sleep seems to be disabled in an interrupt service routine. I'm working on a video to illustrate this - based on this question and the one you asked on my other video. Stay tuned.
@pragmatiktech
@pragmatiktech 2 года назад
Tony: Here you go: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-7_ZSARxaR4k.html
@tonygilkerson
@tonygilkerson 2 года назад
I finally got around to trying this out. I have a single push button and I SetInterrupt for when it is pressed. When pressed I print "hi". This works but sometimes it prints "hi" real quick several times if I don't push the button quickly. I think I heard someone call this pin-bouncing? Can you suggest a technique I can us to avoid this?
@tonygilkerson
@tonygilkerson 2 года назад
I did some searching and found that I can fix in software or hardware, I am better at programming so I will try to fix in software. Looks like I can read the pin value in a loop and introduce a small delay when pressed to debounce. Looks like that can work but seems to make the use of SetInterrupt not needed. I like the SetInterrupt approach so any advice is appreciated
@pragmatiktech
@pragmatiktech 2 года назад
@@tonygilkerson You'll need to debounce your switches. Unfortunately, I couldn't figure out an easy way to debounce in software on the Pico using TinyGo since we need to keep the ISR execution time really small. A simple hardware debouncer might do the trick.
@pragmatiktech
@pragmatiktech 2 года назад
Take a look at github.com/tinygo-org/tinygo/pull/2233/files for a possible example.
@tonygilkerson
@tonygilkerson 2 года назад
@@pragmatiktech I just took a look at that example, I like it... I will try that next. You are a great resource, I appreciate your help. I will report back to let you know if it works,
@pragmatiktech
@pragmatiktech 2 года назад
@@tonygilkerson More than happy to help and to have people like you with whom I can share this learning journey.
Далее
Using PICO Interrupts
25:15
Просмотров 18 тыс.
MINECRAFT CREPPER EXPLODES SHARK PUPPET!
00:15
Просмотров 8 млн
Raspberry Pi Pico - PIO explained
50:01
Просмотров 29 тыс.
TinyGo and Raspberry Pi Pico: Blink LED
12:40
Просмотров 2 тыс.
Inductive current measuring using Raspberry Pi
12:54
Просмотров 52 тыс.
Raspberry Pi Pico & VL53L0X for MicroPython
39:40
Просмотров 8 тыс.