Android Question ioio and pulseinput

jimseng

Member
Licensed User
Longtime User
Hello.
I have finally got my ioio working. I am using ioio library v1.9 because my ioio is v4 firmware.

Can someone help me out with pulseinput. I have based my code on IOIO workbench and I get a result once. How do I continue to recieve results on a continuous basis? In a timer? Do I have to close the pulseinput and re-open it once it has returned a result. I want to make a rev counter from a 12v motorbike pulse from the ignition system so it will be in the region of 100 ms or less pulses
Can anybody help me out?
 

jimseng

Member
Licensed User
Longtime User
Ok. I think I have answered my own question.
In a timer I have :
B4X:
pwmi.Frequency("frequency")

and
B4X:
Sub frequency_done(noerror As Boolean, freq As Float)
    'done event for frequency reading
    If noerror Then                                                                     
 
        msglbl.Text=(freq&" Hertz")
    Else
        Dim trouble As Exception
        trouble=LastException
        comments.Append(trouble.Message&CRLF&"frequency read error"&CRLF&CRLF)
 
    End If

It seems to work. If anybody has any other ideas I would like to hear them. This has been an uphill struggle with various library versions and trying to establish what firmware is running on the ioio. You can't query the firmware version until you have a library that matches and you can't find a matching library until you know what firmware version you are running. Catch 22! And android > 4.0 can't connect over USB apparently, it has to be bluetooth.
I have learned a lesson. Buy from eBay and you get an out of date board.
 
Upvote 0
Top