Searching \ for ' program syntax' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=program+syntax
Search entire site for: 'program syntax'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] program syntax'
2001\01\08@141118 by sunset97

flavicon
face
i'm trying to write the code for a security system on the BS2
this is my first time using a basic stamp though

i will have external circuits and sensors attached to my stamp but for right
now i'm hardcoding everything just to test it ...


alarms var nibble
motion var alarms.bit0
noise var alarms.bit1
glass var alarms.bit2
door var alarms.bit3

alarms.bit0 con 1
alarms.bit1 con 2
alarms.bit2 con 3
alarms.bit3 con 4
buzz con  7
light con  8
light1 con  9

alarms = [1001]
GOSUB check

alarms = [0010]
GOSUB check

alarms = [1000]
GOSUB check

alarms = [0100]
GOSUB check

end

check:
alarms =INA
Branch INA,[check,,message,message,alarm,message,alarm,alarm,alarm,light]
RETURN

LED:
low light
pause 250
high light
RETURN

Message:
FOR counter 0 to 3
GOSUB blink
NEXT

blink:
low light1
pause 50
high light1
pause 50
RETURN

Alarm:
low buzz
pause 50
high buzz
RETURN

- thanks :-)
LaQuida

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\01\10@020657 by dr. Imre Bartfai

flavicon
face
Hi,

I do not know, what do you want to know. However, the line marked below is
bogus. For test, comment it out. Furthermore, the line below with BRANCH
change INA to alarms. Then, I do not know what do you intend with CON
statements below as it seems for me a redefinition of already defined
objects and such way it is illegal.

Regards,
Imre

On Mon, 8 Jan 2001, sunset97 wrote:

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...