File size: 371 Bytes
a2a15a2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
10 REM "Knock from Arduino examples"
20 REM "L led pin, K piezo pin, T threshold"
30 L=13
40 K=AZERO
50 T=100
60 V=0
70 S=0
100 REM "setup() put your setup code here, to run once:"
110 PINM L, 1
200 REM "loop() put your main code here, to run repeatedly:"
210 FOR I
220 V=AREAD(K)
230 IF V<T GOTO 270
240 S=NOT S
250 DWRITE L, S
260 PRINT "Knock!"
270 DELAY 100
280 NEXT
|