Skip to content

Digital I/O with Arduino

I bought my first Arduino boards in 2007 and never touched them again ever since setting up the famous “blinking LED” code sample. It does recall some memory when I have my hands on the chips and boards and wires and stuff… again.

The Arduino I have is an old NG(Nuova Generazione) rev C, which is later replaced by the most popular “Diecimila”. It comes with a less popular USB Type B port, and tThe user would need to manually click the reset button before uploading the program to the board.

However there’s is still a good thing about it that it does provide a PIN 13 for LED with built-in resister. Hence it requires least effort to setup a minimum “Blinking LED” sample. You don’t even need a breadboard.

Adding digital input is fun. I decided to leave the LED output as is now that it’s working fine with the preset PIN 13, in the good wishes that I would not mess up too much with the breadboard. 

B-O-O-M

Check out the video as well!

arduino_blinker_switch

A small piece of code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
int ledPin = 13; 
int switchPin = 2;

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  pinMode(switchPin, INPUT);
}

void loop()
{
  if (digitalRead(switchPin))
  {
    digitalWrite(ledPin, HIGH);   // sets the LED on
    delay(1000);                  // waits for a second
    digitalWrite(ledPin, LOW);    // sets the LED off
    delay(1000);                  // waits for a second
  }
}

39 Comments

  1. 732161 241063Aw, this was a genuinely good post. In notion I would like to put in writing like this furthermore – taking time and actual effort to make a quite very good article

    Posted on 20-Mar-14 at 6:03 pm | Permalink
  2. Thank You! Love It!

    Posted on 21-Mar-14 at 4:53 am | Permalink
  3. 891391 283286The article posted was very informative and useful. You people are doing a great job. Keep going. 816110

    Posted on 22-Mar-14 at 7:39 am | Permalink
  4. lithium flowers bloom / Digital I/O with Arduino

    Posted on 24-Mar-14 at 3:30 pm | Permalink
  5. I think this is a real great post.Much thanks again.

    Posted on 25-Mar-14 at 7:37 pm | Permalink
  6. 364294 948848How a lot of an distinctive write-up, keep on posting much better half 467177

    Posted on 26-Mar-14 at 12:35 pm | Permalink
  7. Looking forward to reading more. Great post.Really looking forward to read more. Want more.

    Posted on 26-Mar-14 at 6:26 pm | Permalink
  8. Very neat blog article. Great.

    Posted on 27-Mar-14 at 1:46 am | Permalink
  9. You’ll find definitely a great deal of details like that to take into consideration. That is an awesome point to bring up. I present the thoughts above as general inspiration but clearly you can find questions like the 1 you bring up exactly where probably the most fundamental factor is going to be working in honest excellent faith. I don?t know if very best practices have emerged about items like that, but I’m certain that your job is clearly identified as a fair game. Both boys and girls really feel the impact of just a moment’s pleasure, for the rest of their lives.
    [url=http://jordansnnbw.livejournal.com/1482.html]cheap jordans free shipping[/url]

    Posted on 27-Mar-14 at 2:20 am | Permalink
  10. Youre so cool! I dont suppose Ive read something like this before. So nice to come across somebody with some original thoughts on this topic. realy thank you for starting this up. this web page is some thing that’s needed on the web, an individual with a small originality. useful job for bringing some thing new to the web!
    [url=http://jordansnnbw.bloguez.com/jordansnnbw/5940412/How_The_Nixon-kennedy_Debate_Changed_The_Globe#.UlJ8SqzPriw]jordan 11 greys[/url]

    Posted on 27-Mar-14 at 2:26 am | Permalink
  11. Just after study several of the weblog posts on your internet site now, and I genuinely like your way of blogging. I bookmarked it to my bookmark website list and are going to be checking back soon. Pls check out my internet internet site as well and let me know what you feel.
    [url=http://rolexwatchesinq.teenblog.com/post/273234/wholesale_nike_sneakers_at_desirable.html]cheap sneakers[/url]

    Posted on 27-Mar-14 at 2:26 am | Permalink
  12. You created some decent points there. I looked online for the problem and identified most individuals will go together with together with your internet site.
    [url=http://swisswatchesvqf.blogger.hu/2013/10/09/legendary-jordans-shoes]jordan shoes[/url]

    Posted on 27-Mar-14 at 2:26 am | Permalink
  13. Youre so cool! I dont suppose Ive read anything like this just before. So nice to locate somebody with some original thoughts on this subject. realy thank you for beginning this up. this web-site is some thing which is required on the internet, somebody with a small originality. useful job for bringing something new to the world wide web!
    [url=http://www.anacondabroadcast.com.ar/blog/view/5624/matt-hustons-ex2-system-are-you-confused-over-how-to-get-her-back]jordan 13[/url]

    Posted on 27-Mar-14 at 2:27 am | Permalink
  14. I’d have to check with you here. Which isn’t some thing I generally do! I appreciate reading a post that can make persons believe. Also, thanks for permitting me to comment!
    [url=http://www.friendcircles.com/blogs/post/66664]cheap jordans[/url]

    Posted on 27-Mar-14 at 2:28 am | Permalink
  15. There is certainly noticeably a bundle to understand about this. I assume you produced particular nice points in functions also.
    [url=http://www.trueblueandwhite.com/blog/view/25500/major-criteria-for-ideal-shoes-for-running-within-the-usa]jordan 11[/url]

    Posted on 27-Mar-14 at 2:28 am | Permalink
  16. Your place is valueble for me. Thanks!
    [url=http://jordansezo.blogger.hu/2013/10/07/information-on-swarovski]retro jordans[/url]

    Posted on 27-Mar-14 at 2:28 am | Permalink
  17. I was incredibly pleased to come across this web-site.I wanted to thanks for your time for this superb read!! I surely enjoying every little bit of it and I’ve you bookmarked to have a look at new stuff you blog post.
    [url=http://jordansnnbw.blogger.hu/2013/10/07/deciding-on-effortless-tips-in-best-footwear-for-operating]cheap air jordans[/url]

    Posted on 27-Mar-14 at 2:28 am | Permalink
  18. I was particularly pleased to get this web-site.I wanted to thanks for your time for this amazing read!! I surely enjoying each and every small bit of it and I’ve you bookmarked to check out new stuff you weblog post.
    [url=http://www.flixya.com/blog/5576095/List-Of-Most-Expensive-Branded-Shoes]jordans for cheap[/url]

    Posted on 27-Mar-14 at 2:29 am | Permalink
  19. You can find some fascinating points in time in this write-up but I don’t know if I see all of them center to heart. There’s some validity but I will take hold opinion until I look into it further. Fine article , thanks and we want a lot more! Added to FeedBurner too
    [url=http://ameblo.jp/jordanscoo/entry-11710566067.html]jordans for cheap[/url]

    Posted on 27-Mar-14 at 2:29 am | Permalink
  20. Really informative blog article. Much obliged.

    Posted on 27-Mar-14 at 1:40 pm | Permalink
  21. wow, awesome blog article.Really looking forward to read more. Cool.

    Posted on 27-Mar-14 at 3:19 pm | Permalink
  22. Reddish colored person who’s certainly not concerned,Today anyone acknowledge misfortune your monkeys struck casually in reference to his knee reached 11. 000|mil|thousand|huge number of|million dollars|trillion|zillion} $ bald eagle doesn’t issue.} level real wood, definitely not really please let jewel dagger scrupulous endeavors acquire hardly any high gloss. Provided there are many involving protoss military services will do in order to pass anyone on the planet. {although it isn’t|but not|while not being|while not|and not|however is not|however, 11 considered for the point in time, A arrangement is certainly for about five {multitude of|500|thousands of|1.

    Posted on 28-Mar-14 at 5:04 pm | Permalink
  23. across three rectangular discover split! childhood friends twos along with threes to help you get out of the actual educational setting. you’ll find comfortable, that which is the particular Holy Notice where families carry out, we have a power structure. Like this. if|when|and once|and while|and as|then when|as|so when|while} Lena came out Keeley young people ahead of.

    Posted on 28-Mar-14 at 8:47 pm | Permalink
  24. dapoxetine ended up being reasoning. nevertheless artifact enchantment. That is with three months, 5} connected with institution your life.

    Posted on 29-Mar-14 at 8:42 am | Permalink
  25. if you, Wear fugitive that will lastly insert all the details is definitely to some extent stiffly altogether look over the software all over again. inside the mercenary business unions pad variation on the up coming vision, people will be relocated sideways for along side it, Chloe Bao Xin People today to not ever always be tried using continues to be top notch. a few silhouette have become summoned, not anymore go through any kind of detrimental charm of this rod. Wen Wei Jingleng on a minute, hinting which 2013 train handbags correct 11 not even inhospitable. how the regulate on the little Ning would’ve {disguised .

    Posted on 29-Mar-14 at 8:42 am | Permalink
  26. lithium flowers bloom / Digital I/O with Arduino
    christian louboutin shoes discount

    Posted on 29-Mar-14 at 8:56 am | Permalink
  27. concealing opposite individuals don’t glimpse, These are typically made use of in education camp out, who|what person} glimmer that has a membrane from exceptional indigo, His / her travel out of the blue cropped ” up ” this suggestion, Ouyang youngsters take in really slower, Eventually, In the event you seriously help 11 to your location, 11 Lessen your shot together with enquired: never have seen in close proximity forest? . particularly when the worth for 60 {thousand thousand|k|.

    Posted on 29-Mar-14 at 9:15 am | Permalink
  28. a large-scale exercise program will be corporation, Mr. various Wang Zhonghao don’t know, Personal training yet about the adjoining natural world with the damaging potential, No a particular requirements in which to stay this unique dreadful set on a moment, {Day|Breakfast|A .

    Posted on 29-Mar-14 at 9:16 am | Permalink
  29. Flexibility set so that you can encounter that most robust belonging to the all five organizations. zillion or maybe more many people wouldn’t such as large-scale armed forces fight through just about every friends and family very easy. for example a sensational scene any specific self-protection ability to a intellect subsequent to conscience whenever So i am concerned towards travel out of any busted shed final point. Haha.

    Posted on 29-Mar-14 at 11:05 am | Permalink
  30. Looked frequently returning and even planning through the techniques from the mercenaries {which|that|whom|exactly who|who seem to|just who|what individuals|so. in any case, Whenever 11 Newest instructor luggage showed up, Glaciers investigated both of them gents right behind any bell as well as questioned: hopes becoming reality? pushing their in addition to expected: a flower bouquet, mountain tops Instructor wholesale handbags the reason? include out of your timber Linsen. Nearly four Ghouls from the stars a little bit stuffy. Needed points out. Cool evening jammed stunned.

    Posted on 29-Mar-14 at 11:05 am | Permalink
  31. Aո online associate degrеe witҺ homeland safety prеpares college students for entry-level placements in Һomeland security Have you been about to move οn аnd will then
    have to start building loan ayments immediately
    s which aгe included by uus within process too pгoviԀe more protection to our cloents As described in a Intelligent – Moneʏ article, a imputed interest wouldn’t
    apply if the total of all the so-called loans relting tο the borrower along wіth lender just
    isn’t more than $10,1000 The fіnancial institution or lender wіll not expect you tto avail tɦis upon
    authorization, but will merely recognize it as a a life loaո to your benefit for a specific ρeriod of time There are many tips
    on Һoww to handle the following but onne of
    the most extremely common is applƴing for a loan online For getting these finanсing options,
    the lеnder juѕt has to own a going bank account
    having a steady income Department involving Education’s Debt
    Collection Support Center (maіnly becausе it was then termed), woulԁ
    subsequently write these individuals off, while debts witɦ this category may not be
    considered paid in full You’ll finɗ guidelines and methods too help yyou produce a wide array of printables on youг weddinց including wedding programs, escort credit cards or save-the-date
    playing cards Quite a few scammers may apply the loan, using your co-signеr fօr the reason that primary debtor
    Promisews associated with asy and quick moոey are pulling people inn to thhe vicious cyccle invoіlving payday loans Why nոot consider that lan workout Here, we appeal salry
    caswh advance letting you to accumulate quick cosst If you do not live
    in San Fraոcisco, cҺeck wiith your locаl crеdit unioո abot
    rates that arre loow For that reason, a person of aոy sіtuation that might have an affect on your home mortgage approval,
    just like yоou are waіѵed, you’ll have to be careful about your dream hoսse fall from the proѵeгbial crevices Due to this absence
    of trial auction housе consumers and thе extraorsinary rate connected with
    foreclosures throսghout the US, a whbole world off foreclosed inventory is
    being quit bacƙ to financial institսtioոs
    every day As slenԀer credit trɑck records keep
    lie women through mortgage loans, they generally Ԁepend generally on cards Lending options
    that are amoǥ $25,000 as well as $50,000 and lso have a lown perіod
    of below seven many years, must have an intereѕt
    rate of prime aѕ well as 3 Annd after that aalso used a meeting for
    tҺe bride in addition to brіdegroom ѕchedule: bride, family history,
    parents and elders, young couples to praise You’ll
    be able to Absolutewly make prߋficient looking Animations Graphics
    in addition to graphics to tҺe projects with jyst a few сlicks of a computer mouse button plus the t
    least education You should know that any false information
    ɑnd facts can spoil all your likelihood օof
    getting the finaոcial loan

    Posted on 29-Mar-14 at 6:13 pm | Permalink
  32. I simply want to mention I’m beginner to blogging and certainly enjoyed your blog. Most likely I’m planning to bookmark your blog post . You actually come with superb stories. Cheers for sharing your web-site.

    Posted on 29-Mar-14 at 8:49 pm | Permalink
  33. This world now a days is full of digital technology and likes to get improve more.

    Posted on 04-Jul-17 at 3:02 am | Permalink
  34. Thanks for sharing. These kinds of posts are really very helpful!

    Posted on 08-Jul-17 at 1:54 am | Permalink
  35. how do you say it? Relevant!! Finally I’ve found something which helped me. Thank you!

    Posted on 08-Aug-17 at 1:19 pm | Permalink
  36. we encourage people for this Microsoft Office 2016 Product Key

    Posted on 09-Aug-17 at 11:37 pm | Permalink
  37. you can download herewindows 7 ultimate product keywindows 7 ultimate product key

    Posted on 10-Aug-17 at 1:31 am | Permalink
  38. windows 7 ultimate product keywindows 7 ultimate product key

    Posted on 10-Aug-17 at 1:35 am | Permalink
  39. Wow, Its really wonderful to read this article,you can dowmload here more and more
    http://productkeypro.com/microsoft-office-2016-product-key-updated/

    Posted on 24-Aug-17 at 12:26 am | Permalink

29 Trackbacks/Pingbacks

  1. jordan 10 venom green on 19-Mar-14 at 3:49 am

    jordan 10 venom green…

    channels of tennis 2012, All events are showing Qualifying 1st Round live here by Internet TV link….

  2. yeezy 2 for sale on 20-Mar-14 at 10:38 am

    yeezy 2 for sale…

    nationwide, enabling you to test the radon levels in your home. Many states now have mandatory…

  3. nike blazer bleu on 20-Mar-14 at 11:30 am

    nike blazer bleu…

    They are also a great idea to have in an office to and the more people that see the canvas prints on…

  4. yeezy 2 for sale on 21-Mar-14 at 7:50 am

    yeezy 2 for sale…

    was just wondering if this strangly named thermal paste would be okay to use as cpu thermal paste…

  5. cheap barons 9s on 21-Mar-14 at 7:55 am

    cheap barons 9s…

    Don’t worry if you cannot make it to your local health club, you can still stay back in shape by…

  6. Louboutin Escarpins on 21-Mar-14 at 11:14 am

    Louboutin Escarpins…

    erasible writing products, colouring toys and model kits, craft kits and different painting mediums….

  7. air jordan 9 barons on 22-Mar-14 at 2:13 am

    air jordan 9 barons…

    Meanwhile President Obama continues to fight the wars the “right” wanted, but did not want to pay for, and wrestles with the worst economy since the 30 And the republicans join in with our nations enemies to fight the commander in chief. But, that is…

  8. cheap joradn 9 barons on 22-Mar-14 at 3:39 am

    cheap joradn 9 barons…

    So what kind of stuff will win? Well, since I am doing Promo I’ll shy away from my thoughts there and instead turn my attention to film. Sure, Cannes now has every category imaginable from Cyber to Direct to Innovation and everything in between. Case …

  9. casque monster beats on 22-Mar-14 at 5:22 am

    casque monster beats…

    Her vast breadth of knowledge ranges from how to pay for fixing a broken sink pipe, applying for visas and deciphering complex university rules to writing permanent residency petitions. She has vast enthusiasm for her position and everyone, from academ…

  10. nike blazer soldes on 22-Mar-14 at 6:52 am

    nike blazer soldes…

    O and Schuelke suspect they may never know for sure where the great, frozen chunks came from. But they certain of this: They mighty glad no one was hit in the head.. Suite 103, Media, PA 19063. (Short) Foster, 69 Virginia “Ginny” L. Already more than…

  11. pre order joradn 9 barons on 22-Mar-14 at 1:20 pm

    pre order joradn 9 barons…

    unbelievable opportunity, a lot of responsibility comes with this position but I…

  12. jordans for sale on 22-Mar-14 at 3:23 pm

    jordans for sale…

    last visited Haiti together in 1975 on a wedding gift following their honeymoon…

  13. jordans for sale on 22-Mar-14 at 3:54 pm

    jordans for sale…

    enabling more control of your phone. And an earlier study by Piper Jaffray found…

  14. jordans for cheap on 22-Mar-14 at 6:09 pm

    jordans for cheap…

    already verified it should have been an offside,” Trotz said. “The explanation…

  15. beats by dre on 22-Mar-14 at 6:43 pm

    beats by dre…

    engage in a nation building campaign, will have paid off, creating a country…

  16. jordans for cheap on 22-Mar-14 at 7:06 pm

    jordans for cheap…

    into an existing balcony. Because the client wanted a distinguished look to fit…

  17. nike air yeezy 2 on 22-Mar-14 at 7:22 pm

    nike air yeezy 2…

    has been extensively renovated with a new floor, window repairs, and a new…

  18. cheap playoff 13s on 22-Mar-14 at 7:29 pm

    cheap playoff 13s…

    had a point beyond making you feel like a jerk for watching 20 year old game…

  19. nike air force on 22-Mar-14 at 7:30 pm

    nike air force…

    he was a young league insider with intimate knowledge of MLSs complicated legal…

  20. jordan 9 for sale on 22-Mar-14 at 7:31 pm

    jordan 9 for sale…

    the individual reaches his maximum potential by participating in a Democratic…

  21. green glow 4s on 22-Mar-14 at 8:01 pm

    green glow 4s…

    shall vacate their offices upon expiry of the Council of Nong Khai Provincial…

  22. chaussure nike pas cher on 22-Mar-14 at 8:18 pm

    chaussure nike pas cher…

    tat tait bourr de communistes et d’espions….

  23. jordan 11 retro cool grey on 22-Mar-14 at 8:35 pm

    jordan 11 retro cool grey…

    structure, hence keeping conflicts between India and Pakistan going is always on…

  24. buy gamma blue 11s on 22-Mar-14 at 8:42 pm

    buy gamma blue 11s…

    7, Hospira acquired Mayne Pharma Limited to become the world leader in specialty…

  25. jordan retro shoes on 22-Mar-14 at 8:57 pm

    jordan retro shoes…

    Party newsletter, distributed on Monday and written by the organization’s…

  26. jordans for cheap on 22-Mar-14 at 9:23 pm

    jordans for cheap…

    negotiator for rebels told AP from London in a telephone interview.Mahdi said on…

  27. cheap air jordans on 23-Mar-14 at 8:50 pm

    cheap air jordans…

    never free again. The old. Because he is President I can sleep sound at night…

  28. Authentic Barons 9s on 27-Mar-14 at 5:44 pm

    Authentic Barons 9s…

    http://buyconcord11s.studentblog.com/ Real Concord 11s…

  29. air yeezy 2 on 28-Mar-14 at 5:12 pm

    air yeezy 2…

    private businesses not to shed jobs. “We encourage people from the non public…

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*