'{$STAMP BS2} ' bully.bs2 ' Ben Levitt 2003 ' This code runs the Bully Blinders clue for the Goonies Game msg data "goto berryessa community center",0 i var word strAddr var word char var byte dot var byte ' This pin watches the people-as-conductors switch input 15 ' These 5 pins are outputs for the LEDs output 0 output 1 output 2 output 3 output 4 ' Set the low byte of the outputs (pins 0-7) to 0 outl = 0 Main: nap 6 if in15 = 0 then Main ' make sure the input signal is real, not just an instantaneous static charge for i = 1 to 200 if in15 = 0 then Main next strAddr = msg StringOut: ' Get the next character of the message read strAddr, char if char <> 0 then Cont goto Main Cont: gosub doChar nap 6 strAddr = strAddr + 1 goto StringOut doChar: ' debug char ' Map the character to an index in this list lookdown char, [" ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"], char ' Map the index onto this combination of braille dots ('F' maps to 7 = braille dots 0,1,2) lookup char, [ 0, 1, 5, 3, 11, 9, 7, 15, 13, 6, 14, 17, 21, 19, 27, 25, 23, 31, 29, 22, 30, 49, 53, 46, 51, 59, 57 ], char ' debug dec char ' debug cr ' show each dot for this letter for i = 0 to 5 if char & dcd i = 0 then skipDot gosub doDot nap 4 skipDot: next return doDot: ' Map a braille dot to two pins/LEDs lookdown i, [0, 1, 2, 3, 4, 5], dot lookup dot, [3, 9, 6,12,18,24], dot outl = dot nap 5 outl = 0 return