Download Print this page

Parallax 27911 Manual page 9

Gyroscope module kickstart

Advertisement

start
send(WRITE)
send(SUB1)
send(data)
stop
PUB Read_1B(SUB3) | rxd
''Read single byte from Gyroscope
start
send(WRITE)
send(SUB3)
stop
start
send(READ)
rxd := receive(false)
stop
result := rxd
PUB Read_MultiB(SUB3)
''Read multiple bytes from Gyroscope
start
send(WRITE)
send(SUB3)
stop
start
send(READ)
multiBYTE[x_idx] := (receive(true)) |
multiBYTE[y_idx] := (receive(true)) |
multiBYTE[z_idx] := (receive(true)) |
stop
x := ~~multiBYTE[x_idx]
y := ~~multiBYTE[y_idx]
z := ~~multiBYTE[z_idx]
PRI send(value)
value := ((!value) >< 8)
repeat 8
dira[SDApin]
dira[SCLpin]
dira[SCLpin]
value >>= 1
dira[SDApin]
dira[SCLpin]
result
dira[SCLpin]
dira[SDApin]
PRI receive(aknowledge)
Copyright © Parallax Inc.
:= value
:= false
:= true
:= false
:= false
:= not(ina[SDApin])
:= true
:= true
(receive(true)) << 8
(receive(true)) << 8
(receive(false)) << 8
Page 9 of 12

Advertisement

loading
Need help?

Need help?

Do you have a question about the 27911 and is the answer not in the manual?