With help from Rob Curtis
it is a good way to count pin_b7s but when you forget your finger on it 8)) it counts by it self I don't want it (when you count a wheels spin it is slow. ok decreasing debounce_delay works but when wheel stops on the button you couldn't see the spins count ) for my job my code is better than yours 8))
-- name : counter.jal -- authors : M.YALIN DUYUR & ROB CURTIS -- date : August 2000 include 16f84_4 include jlib include jseven port_b_direction = all_output port_a_direction = all_output var byte a, b, c, d, x var byte pincount var byte debounce_delay pincount = 0 debounce_delay = 5 a = 0 b = 0 c = 0 d = 0 procedure display (byte in d4, byte in d3, byte in d2, byte in d1) is port_a = 0b_0111 port_b = seven_from_digit (d4) delay_1ms (5) port_a = 0b_1011 port_b = seven_from_digit (d3) delay_1ms (5) port_a = 0b_1101 port_b = seven_from_digit (d2) delay_1ms (5) port_a = 0b_1110 port_b = seven_from_digit (d1) delay_1ms (5) end procedure procedure count is a = a + 1 if a == 10 then a = 0 b = b + 1 end if if b == 10 then b = 0 c = c + 1 end if if c == 10 then c = 0 d = d + 1 end if if d == 10 then d = 0 end if end procedure -- Thanks ROB procedure TestPort is pin_b7_direction = input if pin_b7 & pincount < debounce_delay then pincount = pincount + 1 if pincount == debounce_delay then Count end if else pincount = 0 end if end procedure forever loop TestPort display (d, c, b, a) end loop
Hi I want to make 4 digit Counter(counter.JAL) But I cant convert the file (counter.JAL)to hex file please E-mail me the Hex file by E-mail My E-mail:firstname.lastname@example.org+
|file: /Techref/piclist/jal/counter-mydrb.htm, 2KB, , updated: 2005/3/15 04:02, local time: 2018/1/20 17:05,
|©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://techref.massmind.org/techref/piclist/jal/counter-mydrb.htm"> PIC JAL IO Routine Counter</A>
|Did you find what you needed?|
Welcome to massmind.org!
Welcome to techref.massmind.org!