(4 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
[[Category:AVR Tutorials]]
 
[[Category:AVR Tutorials]]
  
=Objective=
 
 
After blinking the leds, its time to control these leds depending on external inputs. In this tutorial we will interface a DIP switch to one of the Port's and display its status on LED's connected to other port.
 
After blinking the leds, its time to control these leds depending on external inputs. In this tutorial we will interface a DIP switch to one of the Port's and display its status on LED's connected to other port.
  
Line 25: Line 24:
  
 
==LEDs and Switches Wiring diagram==
 
==LEDs and Switches Wiring diagram==
<html><img src ="https://www.exploreembedded.com/blog/wp-content/uploads/img-collections/fritzing-tutorials_de69ccc2/switch_bb.png" width="670 px"></html>
+
[[File:Switch_led_AVR.png]]
  
 
=Explore Ultra AVR Dev Kit=
 
=Explore Ultra AVR Dev Kit=
Line 43: Line 42:
 
<br>
 
<br>
 
{{#ev:youtubehd|-lNAmSNV2-Q|640}}
 
{{#ev:youtubehd|-lNAmSNV2-Q|640}}
 +
 +
[[File:0Switch LED AVR.gif|none]]
 +
 +
 +
= Downloads=
 +
Download the complete project folder from the below link:
 +
https://github.com/ExploreEmbedded/ATmega32_ExploreUltraAvrDevKit/archive/master.zip<br>
 +
  
  
 
Have a opinion, suggestion , question or feedback about the article let it out here!
 
Have a opinion, suggestion , question or feedback about the article let it out here!
 
{{DISQUS}}
 
{{DISQUS}}

Latest revision as of 11:21, 19 April 2016


After blinking the leds, its time to control these leds depending on external inputs. In this tutorial we will interface a DIP switch to one of the Port's and display its status on LED's connected to other port.

Register Configuration

Please refer the below tutorial for basics of GPIO register configuration.

Code

Below points needs to be considered for this example.

  • Include the io.h file as it has the definitions for all the PORT registers.
  • Configure PORTA as inputs to read the switch status.
  • Configure the PORTC as Output to display the switch stauts on Leds.
  • Continuously read the switch status and display it on Leds.

LEDs and Switches Wiring diagram

Switch led AVR.png

Explore Ultra AVR Dev Kit

The Explore Ultra AVR Kit comes with all the things required, not just for this experiment but for the entire series. And even if you think of migrating to PIC or Arduino, you'll have breakout boards that fit on to this, hence we believe it is a great investment for learning hands on Embedded Systems. The kit is fully open source, you may use the schematics, the design files and all of the source code and build something cool on your own. And when you do that do not forget to share with us what you've done. We would be happy to see you building something cool.


Video Tutorial

For those of you, who would like to watch instead of read we have made a video with all the gyan.

0Switch LED AVR.gif


Downloads

Download the complete project folder from the below link: https://github.com/ExploreEmbedded/ATmega32_ExploreUltraAvrDevKit/archive/master.zip


Have a opinion, suggestion , question or feedback about the article let it out here!