
'PLEASE NOTE!

'The tester assumes that you will not light more then ONE LED at a time.
'Do not light multipule LED's at once, or you might overload the I/O pins.
'If you want the sequencer to run faster, make D smaller, or make D larger to slow it down.


Option Explicit
DIM SD%(4)=(00,47,12,10,11) 'E100 SD card pins
DIM FEEL%(5)=(00,40,11,12,01,10) 'E100 touch pins
DIM BUS%(13)=(00,93,94,98,99,100,03,04,05,42,58,06,19,18) 'E100 LCD bus pins
DIM PACK%(8)=(00,15,14,03,07,25,02,23,06) 'Micromite Backpack pins
DIM X,D=250 'D is the delay between LED's lighting - change to whatever suits.
DIM K$
Setpin 6,dout 'LCD RD pin - bypass 10k pull-up to prevent LED lighting till we want it to.

BEGIN:
Print "E100/BACKPACK PORT TESTER 1A"
Print "(N) No Copyright - use however you like. ;)"
Print
Print
Print "[1] - Test E100 SD pins(on CON9, NOT uSD on 1D boards!)"
Print "[2] - Test E100 TOUCH pins"
Print "[3] - Test E100 LCD display bus"
Print "[4] - Test Micromite BACKPACK connections"
Print
Do
  K$=Inkey$
Loop until K$<>"" 'Wait for a keypress...
Select Case K$

Case "1" 'Test SD card connections
  For X=1 to 4
    Setpin(SD%(X)),DOUT 'Set the SD card pins as outputs
  Next
  Do
    For X=1 to 4 'Step through each pin, lighting an LED as we go
      Pin(SD%(X))=1
      Pause D
      PIN(SD%(X))=0
      Pause D
    Next
  Loop until inkey$<>""
  Goto BEGIN

CASE "2"
  For X=1 to 5
    SetPin(FEEL%(X)),DOUT 'Set the touch pins as outputs
  Next
  Do
    For X=1 to 5 'Step through each pin, lighting an LED as we go
    Pin(FEEL%(X))=1
      Pause D
      PIN(FEEL%(X))=0
      Pause D
    Next
  Loop until inkey$<>""
  Goto BEGIN
  
Case "3"
  For X=1 to 13
    SetPin(BUS%(X)),DOUT 'Set the LCD pins as outputs
  Next
  Do
    For X=1 to 13 'Step through each pin, lighting an LED as we go
    Pin(BUS%(X))=1
      Pause D
      PIN(BUS%(X))=0
      Pause D
    Next
  Loop until inkey$<>""
  Goto BEGIN
  
Case "4"
  For X=1 to 8
    SetPin(PACK%(X)),DOUT 'Set the Backpack LCD pins as outputs
  Next
  Do
    For X=1 to 8 'Step through each pin, lighting an LED as we go
    Pin(PACK%(X))=1
      Pause D
      PIN(PACK%(X))=0
      Pause D
    Next
  Loop until inkey$<>""
  Goto BEGIN

END SELECT



