element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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
  • Settings
Arduino
  • Products
  • More
Arduino
Quiz Test your Knowledge of Arduino Fundamentals: Part I: Quiz
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 16 Feb 2020 5:22 AM Date Created
  • Last Updated Last Updated: 6 Jun 2024 4:57 PM
  • Views 30648 views
  • Likes 20 likes
  • Comments 215 comments
Related
Recommended

Test your Knowledge of Arduino Fundamentals: Part I: Quiz

Arduino Fundamentals I

Arduino Fundamentals I
Complete our Arduino Fundamentals I quiz , like the document, and leave your feedback as a...

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.

 

Profile

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

  • e14quiz
  • featured_arduino
  • arduino fundamentals: part i: quiz
  • arduino fundamentals
  • quiz
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • beacon_dave
    beacon_dave over 6 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 6 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 and brought…
  • BigG
    BigG over 6 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."
  • WestfW
    WestfW over 4 years ago

    So how does one create a quiz like this, anyway?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rsjawale24
    rsjawale24 over 4 years ago

    knob? what kind of I/O device is it?
    Great quiz!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • robogary
    robogary over 4 years ago

    couple of those questions skunked me :-)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • albertabeef
    albertabeef over 4 years ago

    tough one image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • spinden
    spinden over 4 years ago

    Thanks!

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • robotrobi
    robotrobi over 4 years ago

    Csak megvan56%.De ez itt mi:

    Jaj nem egészen teljesítetted az évfolyamot.

     

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rajat619
    rajat619 over 5 years ago

    Something like this make us dig deeper into concepts which we never know even when we do projects on arduino, so its a great idea to keep these kind of quiz to gain knowledge.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • phoenixcomm
    phoenixcomm over 5 years ago in reply to WestfW

    WestfW Bill this is a never-ending story! I know that setup is a function in C++ but I still disagree.

    let say you want to initialize an array[] = {{........ll.}, {.....}...............} is fine.

    when I set my IO pins to names  I do it with #defines as it makes life easier and this is in its own file. that is included before the setup().

    saying this you could make your assignments with a loop ie..   for ( int i = 22;  i < 40;  i++ ) {

    if ( i > 30 ) { set pinMode (i, OUTPUT); }

    else {

    set pinMode (i, INPUT); }

     

    now about loop(), main(0, init() personly I set up my code like blocks one sits on the other. so this is what I do:

     

    //each function  has  a assoceated .h file and some times 2 as some may be public, and some private.

    #include main.h // this has a lot of things the main() needs

    #include inti.h // most of stuff that the init needs

    int main ( argc, argv) {

        init() // this is atken to setup

        setup() { the Radio Sub Stystem in my Sim, init and setup are very diferant animials. }  

       do {

    } while(  sometihg is true);

     

    ~~Cris

    BTW Modularize your code. easier to read.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • doug65
    doug65 over 5 years ago

    rough, but finally got it

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • WestfW
    WestfW over 5 years 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
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
<>
element14 Community

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 © 2026 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

  • X
  • Facebook
  • linkedin
  • YouTube