Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - LED intensity varies during execution of code

(you are viewing a thread; or go back to list of threads)

LED intensity varies during execution of code (by Ziggy)
I am trying to sequence a few LEDs through a fixed pattern of light flashes.

I apply no modulation tot he LEDs other than the requisite patten of ON OFF steps.

The LEDs are tied to +5V rail and the pins sink current through a resistors.

So no modulation ... and yet the LED brightness varies during the excution of a sequence of 1 second flashes.

Any advice or similar experience and resolution to the problem welcome.
Mon Dec 11 2017, 07:59:57
(no subject) (by MGP)
Always post your program if you have questions, otherwise we have to guess.
Mon Dec 11 2017, 09:17:45
(no subject) (by Ziggy)
hey MGP... I am sorry i made a mistake in posting the code.
It went into a new message titled sample code rather than as a response in this thread.
Mon Dec 11 2017, 15:22:42
(no subject) (by Ziggy)
P.S. the procesor is ATmega8 runing at 8 MHZ.

As PLC cycle time reduces the aparent LED brightness improves.

At zero ms cycle time it all turns to pudding; the timing is not appropriate.
Mon Dec 11 2017, 15:31:46
(no subject) (by Ihor Nehrutsa)
HOW TO: Soft start and smooth stop of LED with software PWM
https://github.com/LDmicro/LDm...-stop-of-LED-with-software-PWM

HOW TO: Soft start and smooth stop of LED with hardware PWM
https://github.com/LDmicro/LDm...-stop-of-LED-with-hardware-PWM
Sat Dec 16 2017, 12:08:57
(no subject) (by Ziggy)
Ihor,
thanks for the hints.

The problem was caused by multiple rungs whihc controlled the output pins.
So on each cycle the rungs woud be calculate,,, and subsequently as the output pin was calculate and recalculated durin the one iteratio the LED would be activated and deactivaed a number of times resulting in dimming of the led.

My poor coding.
Mon Dec 18 2017, 06:06:19
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):