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
Arduino Forum project of arduino
  • 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
Forum Thread Details
  • State Not Answered
  • Replies 18 replies
  • Subscribers 419 subscribers
  • Views 1738 views
  • Users 0 members are here
Related

project of arduino

e14 Contributor
e14 Contributor over 12 years ago

i want the basic project of arduino with full programmming

  • Sign in to reply
  • Cancel

Top Replies

  • kidiccurus
    kidiccurus over 12 years ago +2
    This is the easiest project possible. Arduino - Blink
  • Robert Peter Oakes
    Robert Peter Oakes over 12 years ago +1
    I am sorry but you need to provide a bit more detail of what you need help with Provide schematic, and or Code up to now, pictures, sketches etc. thanks
  • Robert Peter Oakes
    Robert Peter Oakes over 12 years ago in reply to crosseyejack +1
    void setup() { pinMode(13, OUTPUT); } void loop() { digitalWrite(13,!digitalRead(13)); delay(1000); }
Parents
  • Robert Peter Oakes
    0 Robert Peter Oakes over 12 years ago

    I am surprised we have not had comments regarding what we just did, Im sure there are plenty of new comers that are just shaking their head image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • crosseyejack
    0 crosseyejack over 12 years ago in reply to Robert Peter Oakes

    But its always fun to just mess about with code for just fun. Anyways it has been a while since I've played with Arduino's compiler but I've just had a quick 10 min play while waiting for something else to finish.

     

    While the first delay(1000); adds 190 bytes to the program every other delay(1000); only adds 12 bytes where each _delay_ms(1000); adds 18 bytes to the program so depending on how many delays you have in your program you might find its more efficient to use the Arduino delay(); over the AVR Libc _delay_ms(); A quick of the top of my head calculation would put that number around the 30 mark.

    void setup() {  
    DDRB = DDRB | B00100000; // set pin 13 to output    
    } 
    void loop() { 
      PORTB = PORTB ^ B00100000;
      delay(1000);
    }

    Binary sketch size: 666 bytes (of a 32256 byte maximum, 2.06 percent).

    void setup() {  
    DDRB = DDRB | B00100000; // set pin 13 to output    
    } 
    void loop() { 
      PORTB = PORTB ^ B00100000;
      delay(1000);
      delay(1000);
    }

    Binary sketch size: 678 bytes (of a 32256 byte maximum, 2.10 percent).

    void setup() {  
    DDRB = DDRB | B00100000; // set pin 13 to output    
    } 
    void loop() { 
      PORTB = PORTB ^ B00100000;
      delay(1000);
      delay(1000);
      delay(1000);
    }

    Binary sketch size: 690 bytes (of a 32256 byte maximum, 2.14 percent).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • kidiccurus
    0 kidiccurus over 12 years ago in reply to crosseyejack

    By easy, I did not mean short. Short helps, but sensible, easy to read code is just as important. Binary sketches are a little to difficult for a first project. When I made that post I didn't mean it as a challenge, but it's nice to see that you can do so much to such a simple program.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • kidiccurus
    0 kidiccurus over 12 years ago in reply to crosseyejack

    By easy, I did not mean short. Short helps, but sensible, easy to read code is just as important. Binary sketches are a little to difficult for a first project. When I made that post I didn't mean it as a challenge, but it's nice to see that you can do so much to such a simple program.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • crosseyejack
    0 crosseyejack over 12 years ago in reply to kidiccurus

    Yeah we got a little carried away with just messing around with code. Using digitalWrite(); is a lot simpler as the Arduino core handles all the bit handling and pin addressing for you. Sure on the ATMega328/168 DDRB = DDRB | B00100000; will set Arduino Pin 13 as an output but the Arduino is not just based around that ATMega. If you were using the Leonardo which is based around the ATMega32U4 pin 13 is actually C7 so if you wanted the same blink program running on the Leonardo you would have to change the code to:-

    void setup() {     
    DDRC = DDRC | B10000000; // set pin 13 to output       
    }    
    void loop() {    
      PORTC = PORTC ^ B10000000;  
      _delay_ms(1000);
    }

    Which isn't friendly to newcomers. digitalWrite(); gets rid of the headache and just handles all that for you.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 12 years ago in reply to kidiccurus

    I agree with you there, and you right, we love to make challenges at the drop of a hat, can be fun. and I do get you when your referring to short not being the goal, we just could not resist image

     

    this level of coding is far from simple, coding this way requires a much deeper understanding of the underlying hardware down to registry names and bit patters, not to mention the boolean algebra image

     

    Where this kind of coding becomes VERY useful is in tight timing situations

     

    try this

     

    write a loop using only digital write and turn on and off an output pin as fast as you can (So no delay function call), run it on your ATMEGA328 based Arduino (UNO for example)

     

    measure the frequency of that, yes it will be cpu dependent but were doing a relative measure here so it is not a problem

     

    now (If you have one) run it on an ATMEGA2560 and measure the frequency

     

    both boards run at the same speed but you will find the mega is significantly lower frequency

     

    now write the code in the way we have above and run on both boards, they will be almost identical

     

    Why, well the ATMEGA has much more IO and the base arduino runtime that allows people to code the "Regular" way performs significant checks and mappings before it allows your code anywhere near the hardware

     

    When you code the "Fancy" way, you as the programmer take on that responsibility. You can actually look at the code for the digital write and read if you want, all the source is there in the arduino IDE library files

     

    Code version A

    void setup() {     
    pinMode(13, OUTPUT);           
    }    
    void loop() {    
         digitalWrite(13,!digitalRead(13));       
    }


    UNO = 58.785Khz

    MEGA = 36.91Khz


    Code version B

    void setup() {    
    DDRB = DDRB | B00100000; // set pin 13 to output      
    }   
    void loop() {   
      PORTB = PORTB ^ B00100000;    
    }

     

     

    Note the bits are slightly different on the mega, this library now maps PB5 to output D11 (PB7 is the new D13), either move your measurement tool or change the code

    UNO = 497.87Khz

    MEGA = 467.9Khz

     

    WOW, what a difference, so even a new comer can see that if you need a fast output change, you have to resort to different coding, the best you can get if you don't is 58Khz (Assuming your not doing other code as well), there are hardware timers that of course can do better but this is to demonstrate a point of code overhead. So with a different coding technique your about 10 times faster (In this example, mileage will vary)

     

    Peter

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube