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

0 Members and 1 Guest are viewing this topic.

Offline TrumpkinTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,176
  • 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,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
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,176
  • 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: 335
  • 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,176
  • 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,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
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

 


Get Your Ad Here