A 16 LED output board



This little board was built in to easily test the 16 outputs of my larger interface.  I won't insult readers with a circuit diagram. The cathode of each LED goes to its own port and the anodes are all connected to the positive supply. Each LED is protected by a 560 Ohm current limiting resistor.


The 16 LED output board The pcb


Above is the pcb, which when you print it should be four inches across. Below is a simple program to test the board.


   10 REM Flash_16LEDs
   11 REM Test 16*LED board with Interface Mark 2
   20 REM Jochen Lueg
   30 REM 5th December 2012
   31 REM http://roevalley.com
   40
   50 ON ERROR PRINT REPORT$;" at line ";ERL:END
   60
   70 PROCinit
   80
   90 PRINT "Press Escape to finish"
  100 FOR Loop% = 1 TO 4
  110   FOR J% = 0 TO 15
  120     SYS "GPIO_WriteData",Port%(J%),1
  140   NEXT
  150   TIME=0:REPEAT UNTIL TIME > 50
  160   FOR J% = 0 TO 15
  170     SYS "GPIO_WriteData",Port%(J%),0
  180   NEXT
  190   TIME=0: REPEAT UNTIL TIME >30
  200 NEXT
  210
  220 FOR I%=1 TO 4
  230   FOR J%= 0 TO 15
  240     SYS "GPIO_WriteData",Port%(J%),1
  250     TIME=0:REPEAT UNTIL TIME>5
  260     SYS"GPIO_WriteData",Port%(J%),0
  270   NEXT
  280  
  290   FOR J%= 15 TO 0 STEP-1
  300     SYS "GPIO_WriteData",Port%(J%),1
  310     TIME=0:REPEAT UNTIL TIME>5
  320     SYS"GPIO_WriteData",Port%(J%),0
  330   NEXT
  340 NEXT
  350
  360 FOR I%=1 TO 4
  370   FOR J%= 0 TO 15
  380     SYS "GPIO_WriteData",Port%(J%),1
  390     TIME=0:REPEAT UNTIL TIME>1
  400     SYS"GPIO_WriteData",Port%(J%),0
  410   NEXT
  420  
  430   FOR J%= 15 TO 0 STEP-1
  440     SYS "GPIO_WriteData",Port%(J%),1
  450     TIME=0:REPEAT UNTIL TIME>1
  460     SYS"GPIO_WriteData",Port%(J%),0
  470   NEXT
  480 NEXT
  490
  500 FOR I%=1 TO 20
  510   FOR J%= 0 TO 15
  520     SYS "GPIO_WriteData",Port%(J%),1
  530     FOR T%=1 TO 100000:NEXT
  540     SYS"GPIO_WriteData",Port%(J%),0
  550   NEXT
  560  
  570   FOR J%= 15 TO 0 STEP-1
  580     SYS "GPIO_WriteData",Port%(J%),1
  590     FOR T%=1 TO 100000:NEXT
  600     SYS"GPIO_WriteData",Port%(J%),0
  610   NEXT
  620 NEXT
  630 END
  640
  650
  660 DEFPROCinit
  670 OSCLI"RMEnsure GPIO 0.00 RMLoad GPIO"
  680 OSCLI"RMensure GPIO 0.40 ERROR Please install the GPIO module"
  690
  700 SYS"GPIO_EnableI2C",0
  710 SYS"GPIO_ExpAsGPIO",2
  711
  720 SYS"GPIO_GetBoard" TO PiType%
  730 DIM Port%(15)
  740 REM ISSUE 1
  750 IF PiType%=11 Port%()=1,4,17,21,22,10,9,11,7,8,25,24,23,18,15,14
  760 REM ISSUE 2
  770 IF PiType%=12 Port%()=3,4,17,27,22,10,9,11,7,8,25,24,23,18,15,14
  780 ENDPROC


Back to the interface section 
 
Visit Limavady and the Roe Valley
Tudor with sign