And there it was, the Arduino Add-in!
True to form, I installed it and just started clicking buttons to see what happened! After installation, it seemed to want to talk to the Arduino, so I just plugged it in and let it. Again, after many bad button clicks (which have all been edited out of this video) I managed to get what seemed like the "baseline app" open and some kind of libraries installed, although admittedly I have no idea what I just did. But that's the spirit of making, right! Adventure!
At some point, there were enough buttons that I got scared and needed a Skittles break.
Coming back, I realize that there are Pins labeled in the Matlab app, so I try putting HIGH under Pin 13. Of course, it wants a number, so as a shot in the dark, I try 1. Yay, no error! Then I see a button that says "Generate Script." That sounds promising, let's click that.
I got a bunch of code and in a bit I realized I could run it from Matlab and it would send the code to the Arduino board. I was able to turn the light on, but it wasn't blinking because I hadn't asked it to. I put in a quick for loop so that it would blink 10 times, sent it to the board, and voila, it worked!
(The video doesn't show all the missteps or the actual blinking, but I swear it happened!)
Then finally I wanted to prove to myself I could do something a little different, so I did five double-blinks. In this video you can see me click Run, and then see the board respond.
Here is the code:
for i = 1:5
writeDigitalPin(arduinoObj, "D13", 1)
pause(.25)
writeDigitalPin(arduinoObj, "D13", 0)
pause(.25)
writeDigitalPin(arduinoObj, "D13", 1)
pause(.25)
writeDigitalPin(arduinoObj, "D13", 0)
pause(1)
end
And here is the video:
No comments:
Post a Comment