Yes, I have two pull up resistors (10 kOhm) from pins 4 and 5 to 3.3V(IOIO) is that correct way of connecting them ? When I measure the resistance connected I get about 6.6 kOhm. I don't have any delays between writeRead commands, but I am running the code with debugger, and all reads from the sensor always return 0's. I also tried to change
TwiMaster.Rate.RATE_100KHz when opening twi-line, but the same result perjantai 16. lokakuuta 2015 19.04.04 UTC+3 Ytai kirjoitti: > > Did you remember pull up resistors on the bus? > On Oct 16, 2015 8:50 AM, "Tyler Trombetta" <[email protected] > <javascript:>> wrote: > >> I went back and re-read the data sheet more thoroughly, and it appears I >> was wrong. I just found the example on page 18 that details how to take a >> single measurement. Looking at your first post, I see that's where your >> code comes from. I now think you did everything right, except for waiting 6 >> ms for the data to be placed into the data registers. >> >> So, I would revert back to your first code attempt, but place the line: >> Thread.sleep(6); >> after writeRead() command #2, to have the IOIO wait 6 ms for the data to >> be available. Then you should be able to properly read the data. >> >> It can't hurt to write to the configuration registers before the >> measurement (as in the example), so I would recommend that as well. Sorry >> to lead you down the wrong trail. >> >> Tyler >> >> -- >> 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/d/optout. >> > -- 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/d/optout.
