go_away

Author Topic: Atmega 8 (or 168) programmable LED  (Read 4893 times)

0 Members and 1 Guest are viewing this topic.

Offline TrumpkinTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,177
  • Helpful? 5
Atmega 8 (or 168) programmable LED
« on: August 04, 2008, 11:23:31 AM »
Is port d6 the right pin to connect an LED to if I want to program the LED?
Robots are awesome!

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: Atmega 8 (or 168) programmable LED
« Reply #1 on: August 04, 2008, 12:42:51 PM »
you can connect an LED to any port

Offline TrumpkinTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,177
  • Helpful? 5
Re: Atmega 8 (or 168) programmable LED
« Reply #2 on: August 04, 2008, 01:23:17 PM »
So you can plug an LED into a port d, port b or port c? I thought it had to be port D.
« Last Edit: August 04, 2008, 01:38:08 PM by Trumpkin »
Robots are awesome!

Offline bens

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 329
  • Helpful? 3
Re: Atmega 8 (or 168) programmable LED
« Reply #3 on: August 04, 2008, 02:06:45 PM »
I don't know what you mean by "program the LED".  You pass current through an LED and it lights.  Since the mega8/168 can safely source or sink up to 40 mA with its digital I/O pins, it can light standard LEDs (which typically have good brightness at anywhere between 2 and 20 mA).

Connect your LED to any digital I/O pin you want (don't forget to put an appropriate resistor in series with the LED) and then drive that pin high to light the LED (assuming the other side of the series circuit is connected to ground).  Why would you think that you could only use port D pins?

- Ben

Offline TrumpkinTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,177
  • Helpful? 5
Re: Atmega 8 (or 168) programmable LED
« Reply #4 on: August 04, 2008, 02:47:00 PM »
Quote
You pass current through an LED and it lights.
that's what I meant when I said "program the LED".
Robots are awesome!

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: Atmega 8 (or 168) programmable LED
« Reply #5 on: August 04, 2008, 02:54:39 PM »
Yeah I meant to say what Ben said but I didn't use as many words  :P

 

Related Topics

  Subject / Started by Replies Last post
6 Replies
4515 Views
Last post July 05, 2007, 03:04:14 AM
by sotu
2 Replies
1604 Views
Last post August 31, 2009, 05:22:46 PM
by FlakMunkey
0 Replies
641 Views
Last post August 04, 2010, 03:28:21 PM
by W. ZEE
3 Replies
519 Views
Last post December 01, 2010, 02:16:46 PM
by Soeren


Get Your Ad Here

data_list