Yes, the MCU OS tick value is 10 ms as you know. If you want to use I2C I suggest you to guides for this:
Have you tried with this code?
Are you using the SparkFun block with ADC? If you do Jose has been doing some tests to use this block, I think it might be helpful for you:
Is Jose still active on these forums? I have a few questions as to how to modify his code for the block.
Specifically, where did you (jose) read that 0x04 is where you read the data from the I2C? I looked at the data sheet, and it looks like in order to read ADC data, you need to change the pointer register at 0x01 and then read from the conversion register 0x00, whereas 0x04 is not included in the data sheet.
Are you using this datasheet->http://www.ti.com/lit/ds/symlink/ads1015.pdf ?
I think that Jose is using 0x04 according to the bit configuration (You can change this by using the datasheet) he wanted to use in order to read the buffer.
If you want to contact Jose: Humberto_Garza you can send him a private message in his profile or you can use his github: humberto-garza (Jose Humberto Garza Rosado) · GitHub
Yes, I am using that datasheet.
I'm not sure if you looked through it, but it states that before reading from the ADC, you must write 0x01 to the pointer (which then allows access to the "Conversion" Register that stores the ADC data). After that, you must pass the I2C Address with the read/write bit high, and then read from the Conversion Register.
I realize this is asking for help for the I2C device, but Jose's code doesn't actually follow these processes which makes me wonder if any of this is taken care of in the MCU_API library's I2C functions. In addition, the 0x04 address is nowhere to be found in the datasheet (the pointer values only go up to 0x03) which is why I am asking why this address is being used. Perhaps I am fundamentally misunderstanding what is going on, but the code provided seems much simpler than what the datasheet indicates what needs to be done.
Edit: If there were some sort of "i2c_write_byte" and/or "i2c_read_byte" then that would be useful, but as far as I know, those functions are only available on mraa and not in the mcu_api
Have you been able to work with this? Do you have updates using the ADC with the MCU SDK?
I didn’t see a place where specifically states to use 0x04 so I’m guessing he had set it regarding to the bit configuration he wanted to use.
About the functions for I2C, the availables right now are I2C_write and I2C_read, you can check these in the mcu libraries, mcu_api.h and mcu_errno.h
Sorry for not checking this before, I was not able to login to the site..
Regarding to your question, I totally agree that it should be 0X01 and when i tested it, it did not work, I am not sure why it was, maybe because the map to the MCU of the I2C bus may differ. But doing some testing, I concluded that the register needed was at 0X04, I could not find anywhere that would tell me where it was, so I had to do some testing in order to get it right.
Let me know if you have more questions.
Here is my personal email