Sign in to follow this  
Followers 0
cheesy75

project

3 posts in this topic

hi just browsing for some ideas, I'm not proficient at programming but thought I could learn and have fun at the same time but now im stumped (and just moved house so a little preoccupied) anyway... I made a test rig, 14 leds driven direct from the y outputs with two sensors x1 and x2 the idea being to eventually put them in the stair case so when the beam at the bottom is triggered they will lead up the stairs in sequence and visa versa down wards, now I managed to trip x1 then sequence the leds and reset itself, all using timers, but when it came to going the opposite way easy I thought just reverse the program, but when I did this I got the dreaded double coil and I spent a couple of days on this to no avail, so here I am. open to any suggestions better ways not using timers anything to get me started eventually I thought I could have a selector switch for different patterns, but im getting a head of myself!

Share this post


Link to post
Share on other sites
Check out bit shift instructions. I can't remember what they're called at the moment. I've been working with AB, so that's all I can think of... You can use a timer or other event to trigger the shifts. Then map the shift register to your outputs. Check out bit group addressing for this. For example, you can do the following: MOV D0 K4Y0 This will move four (K4) nibbles (4 bit chunks) of data from D0 to the group of outputs starting at Y0. So, D0 will be mapped to Y0-Y15. Depending on what you shift into the shift register, you could get all sorts of cool patterns. Left shift would take the pattern one way, Right shift would go the other way.

Share this post


Link to post
Share on other sites
Don't have the timers turn on the outputs directly. Instead have them turn on an internal bit. Then at the bottom of your program OR the two bits for each lamp (one for up and one for down) together to turn on the actual output.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0