Josh’s code

Strangely, I can only get half of this on the blog–is there some place where I can change the text size? Well–go to Josh’s blog for the rest!

Here’s the code Josh wrote for Secret Garden:
global [val0 val1 val2 val3 val4 val5]

to powerup
Write portb-ddr $00 ;set all of portb as outputs

loop[
setval0 (read-ad 0) ;sets value of photoresistor to variable valX
print val0
wait 2
setval1 (read-ad 1)
print val1
wait 2
setval2 (read-ad 2)
print val2
wait 2
setval3 (read-ad 3)
print val3
wait 2
setval4 (read-ad 4)
print val4
wait 2

if (val0

Advertisements
This entry was posted in Science. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s