Elenco Snap Circuits SnapMicro ® I Standard User Manual

Page 40

Advertising
background image

39

























Load the program into the micro-controller. As shown in the flowchart, the first two lines make up a
continuous loop. If the input is off (=0) the program just loops around between program lines numbered 7
and 8 on the left side of the program. If the switch is on (=1) the program jumps to the label called ‘BX’.
The state of output pin 4 is toggled and then the program drops into a second continuous loop that waits
for the button to be released. After the button is released the program jumps back to the beginning and
waits for the next push. Take note that only a label command follows the “then” in the “if” statement. No
other words apart from a label are allowed in this position. Keep circuit for next project.

B

C

D

E

F

2

3

4

5

6

A

G

1

7

8

9

10

1

1

1

1

2

2

2

2

2

To Computer

1

2

2

2

2

2

3

1

1

1

1

2

Advertising