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 - sample code

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

sample code (by Ziggy)
OK..

please see the attached diagram.

Idea being that the counters provide time slices during whihc a particular LED is turned on.

LEDS are active LOW. This is to say the microprocessor pin needs to be LOW for the current to flow through the LED.

LOGICALLY the ladder works.
Visually there is variation in LED intensity during the course of operation.

Typically the earlier activity is fainter ( osciloscope shows LED drive to be chopped up) while the last part of display is brighter.

Any comments ...
Is there a particular way of organising LED display so as to minimise this effect?
Mon Dec 11 2017, 15:20:33, download attachment lightshowonly3.ld
(no subject) (by MGP)
If you have leds that are active low then make your program for active high leds and invert the outputs at the end, it's much easier to work with also for simulating the program when you test it with active high leds.

Debounce time is always located after the input contacts.

Look at Rlightshow (S/R) it's always set and 1 cycletime reset, for what reason? and what does it do?
Tue Dec 12 2017, 01:32:32
(no subject) (by Ziggy)
Any comments on variation in light output from LEDs?
Tue Dec 12 2017, 16:15:42
(no subject) (by MGP)
I can't see your leds or schematic, so I can only guess.

There are so many things that can go wrong... usually hardware or wrong setup.

A cycletime of 0.1mS is as for me too short, try 0.2mS or more.
Tue Dec 12 2017, 17:37:33
(no subject) (by Ziggy)
Determined what the problem was.
Code was poorly structured.
The LED drive conditions were not combined into a single statement but rather a number of rungs defining LED conditions.
Each rung would be calculated, do its thing and the net outcome would be an LED accessed multiple times per cycle.

Silly me.
Wed Dec 13 2017, 02:08:41
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):