Writing a new Virtual Peripheral
theoatvecna
Posts: 20
Anyone know how to go about writing a new Virtual Peripheral class? I would like to create a pulse counting VP, and am a bit suprised that one doesn't already exist. Any help would be appreciated.
thanks,
Daniel
thanks,
Daniel
Comments
than the VP's provided with the Javelin.
There is CPU.count() that counts pulses but it does so
for a specified time and as mainline code.
To mimic an interrupt I have written the SimpleTask class
http://groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/util/os/
This is a very simplified variant of the Task class.
The trick is to have any method that takes a long time to complete,
call this simple task so it appears this task runs forever. It only works
for low frequency events (eg. detect a pushbutton press)
regards peter