Download data/examples/06sensors/memsic.bas from introvoyz041/tinybasic: direct link, hf CLI and curl.
- Browser
- Download file 381 Bytes
-
https://huggingface.co/datasets/introvoyz041/tinybasic/resolve/main/data/examples/06sensors/memsic.bas
- Command line
-
hf download hf://datasets/introvoyz041/tinybasic/data/examples/06sensors/memsic.bas
-
curl -L -o memsic.bas https://huggingface.co/datasets/introvoyz041/tinybasic/resolve/main/data/examples/06sensors/memsic.bas
381 Bytes
| 10 REM "Memsic2125 from Arduino examples" | |
| 20 REM "Two axis accelerometer read" | |
| 30 X=2 | |
| 40 Y=3 | |
| 50 DEF FNA(Z)=(Z/10-500)*8 | |
| 100 REM "setup() put your setup code here, to run once:" | |
| 110 PINM X, 0 | |
| 120 PINM Y, 0 | |
| 200 REM "loop() put your main code here, to run repeatedly:" | |
| 210 FOR I | |
| 220 A0=FNA(PULSE(X, 1, 1000)) | |
| 230 A1=FNA(PULSE(Y, 1, 1000)) | |
| 240 PRINT #8, A0, A1 | |
| 250 DELAY 100 | |
| 260 NEXT | |