Posted: Mon Oct 01, 2018 8:19 am Post subject: apds 9930
Hello,
I'm looking for someone who did try or still is struggling to write (in bascom of course) a program for apds 9930. It is gesture/light ambient/proximity wonderful device. So far I can read datas from registers but for some reason I cannot write to registry. Let say if there are registers:
Posted: Mon Oct 01, 2018 4:43 pm Post subject: Re: apds 9930
krolikbest wrote:
wonderful device
Still wonderful, if it don't accept writes?
Code:
i2cwbyte Addr_write
i2cwbyte register1
It's not sufficient to send the register address, you need to form a command, which consists of CMD - TYPE - ADD, see the data sheet.
ADD is actually your register address, TYPE is the form of following up data transfers and CMD is simply bit 7 set to 1.
An example to adress ATIME:
Code:
Const APDS_CMD_repByte = &h80 Or &h00
Const APDS_CMD_autoInc = &h80 Or &h20
Const APDS_CMD_specFunc = &h80 Or &h60
Const APDS_ATIME = &h01
Dim APDS_Command AsByte
APDS_Command = APDS_CMD_repByte OR APDS_ATIME
' now send to I2C
Last edited by MWS on Mon Oct 01, 2018 9:59 pm; edited 2 times in total
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum