How to attach a callback function to the arduino input pin

3 vues (au cours des 30 derniers jours)
Risith Ravisara
Risith Ravisara le 28 Sep 2017
I have 9 led bulbs and 2 pushbutton(not gui button) 9 leds set to 2-10 pins as output. 2 pushbtn set to 12 and 13 as input.
when:
press 1st pushbtn ----> 1st led turn on.
press 2nd pushbtn ----> 2nd led blink forever.
again press 1st pushbtn ----> 3rd led trun on.
again press 2nd pushbtn ----> 4th led blink forever.
again press 1st pushbtn ----> 5th led trun on.
likewise finally 5 leds turn on and 4 leds blink.
This is the task i want to do with matlab using arduino uno. (can't use mega board) I hope this can be done by callback function. but i dont know how to do it.

Réponses (0)

Catégories

En savoir plus sur Arduino Hardware dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by