if (SAU_A == high & SAN_A == high) then
n = 1
repeat
if (n==1 & SAD_A == high) then
repeat
first = adc_read(0) <---<---<---
until(SAD_A == low)
n = n+1
end if
fd = first - ramin
fu = first + ramax
until(SAU_A == low)
end if
If the PIC has data eeprom, use the library pic_data_eeprom.jal
Greets,
Kiste
--
You received this message because you are subscribed to the Google Groups "jallib" group.
To post to this group, send email to jal...@googlegroups.com.
To unsubscribe from this group, send email to jallib+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
I did deliberately not go to much into detail about write cycles and the like... As in this case it seems to be irrelevant. It should be stored on a button press. The data eeprom is specified for 1 million write cycles. Simple pushbuttons are specified for 100 000 or 1 million presses. So that's a good match: One write per button press, both will last the same time. Which is three years, if you press the button once a second, 8 hours a day, five days a week :-)
Greets,
Kiste
Unsigned variables in jal are defined as
var byte*[n] name
where [n] is a positive integer number above zero. There are aliases defined "word" for "byte*2" and "dword" for "byte*4". Just "byte" can be written instead of "byte*1".
So, yes. To store multiple consecutive byte*4 variables, a pointer has to be incremented by four to point to the next free space.
Greets,
Kiste