-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathI2CR.txt
50 lines (41 loc) · 1.91 KB
/
I2CR.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
I2CR
IchigoJam BASIC 0.9.9~
IchigoJam BASIC RPi
IchigoJam PC not compatible
-----------------------------------------------------------
[Function]
It retrieves data from the device connected by the I2C serial bus,
Store it in memory.
[Command format]
<return value> = I2CR(<I2C address>, <command start address>, <command length>, <read memory start address>, <read memory length>)
<return value> = I2CR(<I2C address>, [<command start address>, <command length>,> <read memory starting address>, <read memory length>) (1.2b42 ~)
[Example]
R = I2CR(`1010000,#700,2,#702,16)
R = I2CR(`1010000,#700,16) (1.2 b 42 -)
[Commentary]
<I2C address> is a device that obtains information via I2C.
Depending on the connection of the A0 to A2 terminals to the I2C device
It has a unique slope address. Specify this.
Values range from 0 to 127 (`0000 000 to `1111 111).
After adding the READ / WRITE bit READ to this and transmitting it,
Gets reception from the device.
Please note that it does not include the READ / WRITE bit.
Next from <command start address> to <command length>
Execute the command.
Prepare the command beforehand with POKE.
After that, the data obtained from I2C is read from <read memory starting address>
Store with <reading memory length>.
Please obtain actual value with stored information by PEEK.
<command start address> <read memory starting address> is
IchigoJam's memory location.
<command length> <read memory length> is
Indicates the length in bytes.
I2C which had been adopted until 1.0.0 beta 2
In 1.0.0 beta 3 this I2CR and I2CW have been changed.
Change the program that used I2C,
Please divide the command using VER().
By pressing the Esc key at 1.0.0 beta 11
It is now possible to interrupt reception.
From 1.2b42, with <command start address> and <command length>
You can now omit it. Regardless of the command,
It is now possible to receive arbitrary data.