zombies

date
2003
materials
household lamp, solid state relay, custom electronics, microcontroller, custom code
please enable javascript in order to play video, or download and view high quality mpeg video via the links on the left
[back to main description]

		
'{$STAMP BS2}
'{$PBASIC 2.5}
'{$PORT COM2}

'Anti/Zombie Lamp Code. Ver 1.0, Prototype
'
'Blinks a standard floor lamp in Morse code through an SSR
'at approx 2 wpm.
'For sending out coded messages to other survivors of a major
'urban disaster w/o alerting Zombies, Triffids or like non-
'literate threats.
'Future versions will have battery backup systems, in case
'of major power failure, text entry via keypad or internet,
'optional photocell contolled night only operation to conserve
'power.
'It is customary to install this in the window of a tallish
'apartment building with wide visibility.
'Does not provide protection from any megalomanical military
'types who may still be about.


MORSE VAR Word
LETTER VAR Word

lamp CON 0                      'PIN that light is hooked up too

between_sentences CON 5000      'pause (light off) between each sentence
between_letters CON 500         'pause (light off) between each character
between_didah CON 250           'pause (light off) between each dot or dash
between_words CON 1000          'pause (light off) between each word

dot_on CON  200                 'dot length, light on
dash_on CON 750                 'dash length, light on

letter=0

'------------------------------------------------------
sentence_1:


    LOOKUP letter, ["WE ARE ALIVE#"], morse   'pound is end of sentence char.
    letter=letter+1
    GOSUB encode_as_morse

    IF letter=0 THEN DONE_1
    GOTO sentence_1

done_1:

    PAUSE between_sentences
    GOTO sentence_2

'------------------------------------------------------
sentence_2:


    LOOKUP letter, ["PLEASE DO NOT EAT AND OR MAIM US#"], morse
    letter=letter+1
    GOSUB encode_as_morse

    IF letter=0 THEN DONE_2
    GOTO sentence_2

done_2:

    PAUSE between_sentences
    GOTO sentence_3

'------------------------------------------------------
sentence_3:


    LOOKUP letter, ["FUCK YOU zombies#"], morse
    letter=letter+1
    GOSUB encode_as_morse

    IF letter=0 THEN DONE_3
    GOTO sentence_3

done_3:

    PAUSE between_sentences
    GOTO sentence_4

'------------------------------------------------------
sentence_4:


    LOOKUP letter, ["NO FAMILY#"], morse
    letter=letter+1
    GOSUB encode_as_morse

    IF letter=0 THEN DONE_4
    GOTO sentence_4

done_4:

    PAUSE between_sentences
    GOTO sentence_5

'------------------------------------------------------
sentence_5:


    LOOKUP letter, ["BRING UNCONTAMINATED WATER QUICKLY#"], morse
    letter=letter+1
    GOSUB encode_as_morse

    IF letter=0 THEN DONE_5
    GOTO sentence_5

done_5:

    PAUSE between_sentences
    GOTO sentence_1

'------------------------------------------------------



encode_as_morse:

    SELECT morse

      CASE 32               'ASCII value of "space"
        GOSUB space

      CASE 35               'ASCII value of "#"
        letter=0             'means sentence is done

      CASE 65               'ASCII value of "A"
        GOSUB A

      CASE 66               'ASCII value of "B"
        GOSUB B

      CASE 67               'ASCII value of "C"
        GOSUB C

      CASE 68               'ASCII value of "D"
        GOSUB D

      CASE 69               'ASCII value of "E"
        GOSUB E

      CASE 70               'ASCII value of "F"
        GOSUB F

      CASE 71               'ASCII value of "G"
        GOSUB G

      CASE 72               'ASCII value of "H"
        GOSUB H

      CASE 73               'ASCII value of "I"
        GOSUB I

      CASE 74               'ASCII value of "J"
        GOSUB J

      CASE 75               'ASCII value of "K"
        GOSUB K

      CASE 76               'ASCII value of "L"
        GOSUB L

      CASE 77               'ASCII value of "M"
        GOSUB M

      CASE 78               'ASCII value of "N"
        GOSUB N

      ENDSELECT

SELECT morse

      CASE 79               'ASCII value of "O"
        GOSUB O

      CASE 80               'ASCII value of "P"
        GOSUB P

      CASE 81               'ASCII value of "Q"
        GOSUB Q

      CASE 82               'ASCII value of "R"
        GOSUB R

      CASE 83               'ASCII value of "S"
        GOSUB S

      CASE 84               'ASCII value of "T"
        GOSUB T

      CASE 85               'ASCII value of "U"
        GOSUB U

      CASE 86               'ASCII value of "V"
        GOSUB V

      CASE 87               'ASCII value of "W"
        GOSUB W

      CASE 88               'ASCII value of "X"
        GOSUB X

      CASE 89               'ASCII value of "Y"
        GOSUB Y

      CASE 90               'ASCII value of "Z"
        GOSUB Z

      ENDSELECT

   RETURN

SPACE:

   LOW lamp
   PAUSE between_words
   RETURN

A:                          '.-
   GOSUB dot
   GOSUB dash
   PAUSE between_letters
   RETURN

B:                          '.---
   GOSUB dot
   GOSUB dash
   GOSUB dash
   GOSUB dash
   PAUSE between_letters
   RETURN

C:                          '-.-.
   GOSUB dash
   GOSUB dot
   GOSUB dash
   GOSUB dot
   PAUSE between_letters
   RETURN

D:                          '-..
   GOSUB dash
   GOSUB dot
   GOSUB dot
   PAUSE between_letters
   RETURN

E:                          '.
   GOSUB dot
   PAUSE between_letters
   RETURN


F:                          '..-.
   GOSUB dot
   GOSUB dot
   GOSUB dash
   GOSUB dot
   PAUSE between_letters
   RETURN

G:                          '--.
   GOSUB dash
   GOSUB dash
   GOSUB dot
   PAUSE between_letters
   RETURN

H:                          '....
   GOSUB dot
   GOSUB dot
   GOSUB dot
   GOSUB dot
   PAUSE between_letters
   RETURN

I:                           '..
   GOSUB dot
   GOSUB dot
   PAUSE between_letters
   RETURN

J:                          '.---
   GOSUB dot
   GOSUB dash
   GOSUB dash
   GOSUB dash
   PAUSE between_letters
   RETURN

K:                          '-.-
   GOSUB dash
   GOSUB dot
   GOSUB dash
   PAUSE between_letters
   RETURN

L:                          '.-..
   GOSUB dot
   GOSUB dash
   GOSUB dot
   GOSUB dot
   PAUSE between_letters
   RETURN

M:                          '--
   GOSUB dash
   GOSUB dash
   RETURN

N:                          '-.
   GOSUB dash
   GOSUB dot
   PAUSE between_letters
   RETURN

O:                          '---
   GOSUB dash
   GOSUB dash
   GOSUB dash
   PAUSE between_letters
   RETURN

P:                          '.--.
   GOSUB dot
   GOSUB dash
   GOSUB dash
   GOSUB dot
   PAUSE between_letters
   RETURN

Q:                          '--.-
   GOSUB dash
   GOSUB dash
   GOSUB dot
   GOSUB dash
   PAUSE between_letters
   RETURN

R:                          '.-.
   GOSUB dot
   GOSUB dash
   GOSUB dot
   PAUSE between_letters
   RETURN

S:                          '...
   GOSUB dot
   GOSUB dot
   GOSUB dot
   PAUSE between_letters
   RETURN

T:                          '-
   GOSUB dash
   RETURN

U:                          '..-
   GOSUB dot
   GOSUB dot
   GOSUB dash
   PAUSE between_letters
   RETURN

V:                          '...-
   GOSUB dot
   GOSUB dot
   GOSUB dot
   GOSUB dash
   PAUSE between_letters
   RETURN

W:                          '.--
   GOSUB dot
   GOSUB dash
   GOSUB dash
   RETURN

X:                          '-..-
   GOSUB dash
   GOSUB dot
   GOSUB dot
   GOSUB dash
   PAUSE between_letters
   RETURN

Y:                          '-.--
   GOSUB dash
   GOSUB dot
   GOSUB dash
   GOSUB dash
   PAUSE between_letters
   RETURN

Z:                          '--..
   GOSUB dash
   GOSUB dash
   GOSUB dot
   GOSUB dot
   PAUSE between_letters
   RETURN



dot:
   HIGH lamp
   PAUSE dot_on
   LOW lamp
   PAUSE between_didah
   RETURN

dash:
   HIGH lamp
   PAUSE dash_on
   LOW lamp
   PAUSE between_didah
   RETURN