Monday, 25 April 2011

Code

Here's the final version of the code that we used just in case anyone was wondering.


main:

readadc b.4, b0
debug b0

if b0 > 100 then sound c.7, (100,10)
endif
if b0 < 85 then sound c.7, (0,1)
endif

readadc b.5, b1

if b1 > 100 then sound c.7, (90,10)
endif
if b1 < 80 then sound c.7, (0,1)
endif

readadc b.6, b2

if b2 > 35 then sound c.7, (80,10)
endif
if b2 < 20 then sound c.7, (0,1)
endif

readadc b.7, b3

if b3 > 110 then sound c.7, (70,10)
endif
if b3 < 100 then sound c.7, (0,1)
endif

readadc c.1, b4




if b4 > 30 then sound c.7, (60,10)
endif
if b4 < 15 then sound c.7, (0,1)
endif

readadc c.0, b5

if b5 > 100 then sound c.7, (50,10)
endif
if b5 < 90 then sound c.7, (0,1)
endif

readadc b.1, b6

if b6 > 120 then sound c.7, (40,10)
endif
if b6 < 100 then sound c.7, (0,1)
endif

readadc b.2, b7

if b7 > 30 then sound c.7, (30,10)
endif
if b7 < 17 then sound c.7, (0,1)
endif

readadc b.3, b8 




if b8 > 30 then sound c.7, (20,10)
endif
if b8 < 15 then sound c.7, (0,1)
endif

readadc c.2, b9

if b9 > 35 then sound c.7, (10,10)
endif
if b9 < 20 then sound c.7, (0,1)
endif

goto main

No comments:

Post a Comment