element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Arduino
  • Products
  • More
Arduino
Documents Arduino Fundamentals: Part I: Quiz
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Arduino requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 16 Feb 2020 5:22 AM Date Created
  • Last Updated Last Updated: 18 Nov 2021 7:14 PM
  • Views 3974 views
  • Likes 20 likes
  • Comments 207 comments
Related
Recommended

Arduino Fundamentals: Part I: Quiz

Arduino Fundamentals: Part 1: Quiz

Quiz | Arduino Day 2021  | Workshop | Digital Fever  | Attack of the Drones | Project14 |Arduino Tutorials | Arduino Projects | Arduino Homepage

 

Are you ready to demonstrate your Arduino knowledge? Then take this 25-question quiz to test your knowledge of Arduino and see how ready you are for Arduino Certification.

To earn the Arduino Fundamentals I Badge, attain 100% on the quiz, leave us some feedback in the comments section, and give the quiz a star rating.

 

  • e14quiz
  • featured_arduino
  • arduino fundamentals: part i: quiz
  • arduino fundamentals
  • quiz
  • Share
  • History
  • More
  • Cancel
Anonymous

Top Comments

  • beacon_dave
    beacon_dave over 2 years ago +11

    Question 24 depends on whether or not you are 'sinking' or 'sourcing' the LED which has been connected...

  • tariq.ahmad
    tariq.ahmad over 2 years ago +10

    There's no one way to do #13 so in hindsight it wasn't the best question.   We've made a tweak to the quiz to reflect this and how people actually code.  We thank everyone who took this quiz early…

  • BigG
    BigG over 2 years ago +8

    Hmmm, not so sure about question 13 as you can create code such that either can apply "Place code in _____ to make an LED flash 10 times."

  • doug65
    doug65 over 1 year ago

    rough, but finally got it

    • Cancel
    • Up +1 Down
    • Reply
    • More
    • Cancel
  • WestfW
    WestfW over 1 year ago in reply to phoenixcomm

    void setup() { }  /is only for assingments like i=0, or things that are run once ie. bitSet(TCCR1B, CS12);  // 256 prescaler  NEVER LOOPS!! unless you are Initalizing an arry buy I might just put the array in a .pde file and include it.

    Since you're still posting this opinion after a year, I thought I'd offer a counter-opinion.

     

    1. setup() is just a C++ function.  You can put any code you want inside it.  The statements inside of setup ARE "executable code", so your earlier emphasis ("NEVER put executable code in setup!" is just wrong.  Your examples all contain "executable code."  (loop() is just a C++ function too.  I interpret the current form of the question as checking whether the quiz-ee understands that they're just functions, not "magic names that do something special."
    2. A statement like "Serial.println("Arduino sketch that does neat things!");" inside setup() is entirely appropriate.  And guess what?  It loops (down inside of Print, but still... looping is looping.)
    3. It is a STANDARD RECOMMENDATION, when porting C code to Arduino, to "rename main() to setup() and leave loop() empty."  setup() behaves essentially similar to main() in a normal C program, except it happens after the core code sets up the chip for the Arduino environment.
    4. For the example from the quiz "blink an LED 10 times" (or any "do X for a limited time" scenario), you wind up with three choices:   A) Put a loop in setup().  B) put loop inside of loop() and then have it stop.   C) torture and obfuscate code in loop to let it do the LED thing 10 (perhaps 20) times and then have it stop touching the LED.   All of these have advantages and disadvantages, at least stylistically.  None of them are going to fit well within the "best style for Arduino sketches" because the example is NOT a good example of a typical Arduino application...

     

    void setup() {
      pinMode(13, OUTPUT);
      for (int i=0; i < 20; i++) { // 20 toggles == 10 flashes.  Check for fenceposts!
        digitalWrite(13, !digitalRead(13));
        delay(500);
      }
    }
    void loop() {}

     

     

    void setup() {
      pinMode(13, OUTPUT);
    }
    void loop() {
      for (int i=0; i < 20; i++) {  // 20 toggles == 10 flashes.  Check for fenceposts!
        digitalWrite(13, !digitalRead(13));
        delay(500);
      }
      while (1) ;   // stop
    }

     

    void setup() {
     pinMode(13, OUTPUT);
    }
    int i = 0;   // global counter
    void loop() {
     if (i < 20) {  // 20 toggles == 10 flashes.  Check for fenceposts!
        digitalWrite(13, !digitalRead(13));
        delay(500);
        i++;
      }
      // after 10 flashes, loop will do nothing.
    }

     

    (I should add that I dislike the third example, IF all you need to do is "flash the LED 10x."  However, it is the path that you'd need to go toward if you wanted to "flash the LED 10 times WHILE ALSO DOING SOMETHING ELSE.")

    • Cancel
    • Up +1 Down
    • Reply
    • More
    • Cancel
  • WestfW
    WestfW over 1 year ago

    Question 24 (connect an LED on pin 13) - correct answer actually depends on the details of how the LED is connected.

    It looks to me like question 3 has two correct answers.

    Question 7  (delay(10000)) is poorly worded, IMO.  The "result" is a delay, not just "some number of seconds" (what happens to the new seconds?  Do they get added to the time till the heat death of the universe?  Or maybe to the lifetime of the programmer?)


    I sort of felt that there were a bunch of questions here that tested things that an Arduino user doesn't really need to know.  (instruction pipeline!?)  I've always been a bit hesitant to take the "certification" test, even thought I'm theoretically an experienced C and AVR programmer (I did get 100% on THIS), since I was worried that it would veer away from general engineering into things that were closer to what Arduino users actually do (that I haven't done.)  Like "Multiple I2C sensors can be connected to the same i2C bus as a long as...", or "The following interfaces are commonly used to connect an LCD display to an Arduino..."

    Also... very AVR-centric.  I guess that matches usage statistics, but...

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
  • pavan555
    pavan555 over 1 year ago

    Nice quiz to boost our knowledge.5 stars rating

    • Cancel
    • Up +2 Down
    • Reply
    • More
    • Cancel
  • colporteur
    colporteur over 1 year ago in reply to javagoza

    I suspect, long before your gold sticker there was parental pride.

    • Cancel
    • Up +4 Down
    • Reply
    • More
    • Cancel
  • phoenixcomm
    phoenixcomm over 1 year ago in reply to javagoza

    javagoza   Thanks!

    ~~Cris

    • Cancel
    • Up +1 Down
    • Reply
    • More
    • Cancel
  • javagoza
    javagoza over 1 year ago in reply to phoenixcomm

    For the banded lines:

    1. Select the code to highlight
    2. Then use de Insert button [>>] menu / Syntax Highlighting / c++

    • Cancel
    • Up +1 Down
    • Reply
    • More
    • Cancel
  • phoenixcomm
    phoenixcomm over 1 year ago in reply to javagoza

    javagoza Enrique, this may sound dumb, but how do you get this stupid editor to give you the banded lines????

    and you are quite right about the second form but I did not include it as I did not think they would get it.

    in C there is no square primitive ie number2 The easy way is with a define.

    #define SQUARE(x)  ((x)*(x))

    another good candidate is Pi

    #define pi 3.14159265359

     

    ~~Cris

    • Cancel
    • Up +1 Down
    • Reply
    • More
    • Cancel
  • javagoza
    javagoza over 1 year ago in reply to colporteur

    colporteur lol, mom and dad are going to be proud of me.

    Thanks for the sticker and for your personal and detailed road tests.

    • Cancel
    • Up +1 Down
    • Reply
    • More
    • Cancel
  • colporteur
    colporteur over 1 year ago in reply to javagoza

    Thanks for taking the time to prepare such a detailed write-up. It answered my question and then some. Like in school I felt you deserved a sticker for your efforts.

    • Cancel
    • Up +3 Down
    • Reply
    • More
    • Cancel
<>
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube