Gordons Projects

--> Projects Top-Level GIT

Fixing names
authorGordon Henderson <projects@drogon.net>
Mon, 19 Nov 2012 21:34:42 +0000 (21:34 +0000)
committerGordon Henderson <projects@drogon.net>
Mon, 19 Nov 2012 21:34:42 +0000 (21:34 +0000)
Added in the RTB setup file

ladderSetup.rtb [new file with mode: 0644]

diff --git a/ladderSetup.rtb b/ladderSetup.rtb
new file mode 100644 (file)
index 0000000..b9c833a
--- /dev/null
@@ -0,0 +1,39 @@
+//
+// ladderSetup:
+//    This is the setup procedure. We initialise the various
+//    pins into the correct modes and extinbuish all the LEDs
+//
+DEF PROC ladderSetup
+LOCAL i
+FOR i = 0 TO 9 CYCLE 
+  PinMode (i, 1) // Output
+  DigitalWrite (i, 0) // Off
+REPEAT 
+FOR i = 10 TO 13 CYCLE 
+  PinMode (i, 0) // Input
+  PullUpDn (i, 2) // Activate internal pull-up
+REPEAT 
+//
+// Make some globals
+//
+ledRed1 = 0
+ledRed2 = 1
+ledYellow1 = 2
+ledYellow2 = 3
+ledGreen1 = 4
+ledGreen2 = 5
+ledBlue1 = 6
+ledBlue2 = 7
+gMan = 8
+rMan = 9
+//
+buttonA = 11
+buttonB = 10
+buttonC = 12
+buttonD = 13
+//
+// Leave Green man ON
+//
+DigitalWrite (gMan, 1)
+//
+ENDPROC