I2C troubles


Author Message
georgestheking
Newbie

Joined: 21/12/2021
Location: Belgium
Posts: 32
Posted: 02:11pm 21 Jan 2022      

Thanks Jim,

The code is now :

Rem -------------------------
Rem PICOMITE 5.0701
Rem -----------------------

Option default integer
Option explicit
Dim INTEGER RDATA(8)

Rem  COMPASS GY-26
Sub compass

SetPin GP2,GP3,I2C2

I2C2 OPEN 100,1000
I2C2 WRITE &HE0,0,2,0,&H31 ' send read command &h31
I2C2 READ &HE0,0,8,RData() ' read 8 registers
I2C2 CLOSE

End Sub

DO
compass

print rdata(1)
print rdata(2)

PAUSE 1000
LOOP

But still return 0,0 !!!

Best regards

Georges

PS : pull up resistors are in the right place