PDA

View Full Version : Counter with display



sstiles
02-03-2007, 02:55 PM
I am trying to build a counter that will display a increasing count based on a sensor or switch for an envelope inserter. Ideally, it would also display average speed per hour.

It has been 6 months since I tried to do this project and I am going back to finish once and for all. (newbie if you couldnt tell) I have a basic stamp and an 2x8? lcd that I have scavanged from an old printer. I was able to connect the LCD to the stamp and display a count but, I have since lost my hard drive and no longer have the code. To get to the point each time I would read the state of the switch it would start counting up the count and I wanted it to count once and then not count again until it was open again and then shut. If anyone has a resource on this it would be greatly appreciated or if you can help me·see the flaw in my logic or why it would keep counting let me know. As for some more background, I was plannig on mounting the switch on a cam on the evelope inserter and have it count each revolution, sometimes the inserter stops and then if the switch was depressed it would keep counting. As stated earlier I would also like it to give me a speed based on the avg # pcs per hour.

Thanks

Scott

Franklin
02-04-2007, 01:45 AM
Place a loop inside the counter sequence that will loop until the switch opens and then will continue.
if close countincrement
do until open
loop
next statement

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen