Untitled Document
Physical Computing - Bezalel, Sem. B 2001
Home Page
Class Home | Class List | Links
Previous
next

Example 1: Simple Blink

MYLABLE:
	HIGH 5 		'turn on pin 5
 	PAUSE 1000 	'for 1 second
	LOW 5 		'turn pin 5 off
	PAUSE 1000 	'wait 1 second
GOTO MYLABLE

Example 2: Conditional Blink

In this example- the blink will happen only of light levels go below a certain level

MAIN:
	POT 1,100,B1	'read the pot, scale 100, into B1
	DEBUG B1	'print B1
	IF B1>80 THEN BLINK
GOTO MAIN
	
BLINK:
	HIGH 5 		'turn on pin 5
 	PAUSE 1000 	'for 1 second
	LOW 5 		'turn pin 5 off
	PAUSE 1000 	'wait 1 second
GOTO BLINK