Download data/examples/13wire/analogr2.bas from introvoyz041/tinybasic: direct link, hf CLI and curl.
- Browser
- Download file 295 Bytes
-
https://huggingface.co/datasets/introvoyz041/tinybasic/resolve/main/data/examples/13wire/analogr2.bas
- Command line
-
hf download hf://datasets/introvoyz041/tinybasic/data/examples/13wire/analogr2.bas
-
curl -L -o analogr2.bas https://huggingface.co/datasets/introvoyz041/tinybasic/resolve/main/data/examples/13wire/analogr2.bas
295 Bytes
| 10 REM "I2C analog slave" | |
| 20 REM "A is the analog port" | |
| 30 A=AZERO | |
| 100 REM "the setup()" | |
| 110 PRINT "Open slave mode on port 8" | |
| 120 OPEN &7, 8, 1 | |
| 200 REM "loop() binary data transfer" | |
| 210 FOR I | |
| 220 V=AREAD(A) | |
| 230 A$(1)=INT(V)%256 | |
| 240 A$(2)=INT(V)/256 | |
| 250 PRINT &7, A$ | |
| 260 DELAY 300 | |
| 270 NEXT I | |