Wonderful, well explained and it sounds like just what I need! I'm getting some strange results in Accessory mode (not at all in Bluetooth or regular ADB by USB). Pin 1 in every column occasionally gets a Lot higher. Sounds like your solution resolves these kinds of debounce-oriented problems.. I'll try my luck with upgrading the firmware and I'll get back to you when I've tried it out. ^^
Den söndagen den 12:e januari 2014 kl. 19:56:01 UTC+1 skrev Ytai: > > Yes! > The wait this works is: > > digitalOutPin.write(xxx); // set the output > ioio_.sync(); > float value = analogInPin.readSync(); > > I'm trying to think of a good way to explain the semantics: > The first write will write to the pin asynchronously, i.e. it will send a > message to the IOIO to set the pin state, which will eventually get > executed sometime in the near future, after the method has already returned. > Then, the sync method send a "ping" to the IOIO and then *blocks* until > the IOIO sends back a ping. So by the time the ping returns, we know for > certain that the pin write has completed. Any message arriving *from* the > IOIO after the ping is also guaranteed to have been generated after the > ping has been sent, thus after the output pin has been set. Finally the > readSync() method, unlike read(), will block shortly until a new sample has > arrived from the IOIO, which is now guaranteed to be fresher than the > setting of the output. > > I hope this is semi-clear :) > Let me know if that works OK. It seems to in my tests. > > > > On Sun, Jan 12, 2014 at 8:32 AM, Markus Kaczmarek > <[email protected]<javascript:> > > wrote: > >> Amazing! >> Does this >> >> - Added APIs for synchronizing asynchronous I/O operations. For >> example, it is now possible to write to a DigitalOutput, and then read an >> AnalogInput that was sampled *after* the output pin changed its state. >> >> mean that one no longer needs to open and close the digital out when >> multiplexing matrices? :):) >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "ioio-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> Visit this group at http://groups.google.com/group/ioio-users. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- You received this message because you are subscribed to the Google Groups "ioio-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/ioio-users. For more options, visit https://groups.google.com/groups/opt_out.
