DicePLATFORM

The DicePLATFORM is uses 7 LED on four output pins to simulate a dice roll. By combining different combinations of high low values on the output pins and some code to randomize the result a user can press the push button and generate a number between 1-6.

Video Demo

[youtube_sc url=”http://youtu.be/2Y8k4g3DofQ”]

Assembly Datasheet:

Kit Includes:

2          10 Pin male header
2          6 Pin male header
7          Green 5mm LEDs
1          Push button switch
1          10K resistor
1          1K resistor
4          330 ohm resistors
1          DicePLATFORM PCB

 

Example Code:

' Picaxe Proto Platform by Joel Phillips, www.picaxeprotoplatform.com
' After downloading program to your board open the terminal window under the PICAXE file menu or press F8
' Ensure the selected baud rate in the terminal window is 4800
 
' Pinout for PicaxeProtoPlatform using PICAXE 14M2 Microcontroller.
' "P#" can be replaced with a descriptive word for the input/output pin.
' For example P19 Could be replaced with "GLED" to represent the connected Green LED
 
'SYMBOL P1	= +V		SYMBOL P20 = 0V
 SYMBOL P2	= C.5		SYMBOL P19 = B.0
 SYMBOL P3	= C.4		SYMBOL LED1= B.1
 SYMBOL PUSH= pinC.3	SYMBOL LED4= B.2
 SYMBOL P5	= C.2		SYMBOL LED2= B.3
 SYMBOL P6	= C.1		SYMBOL LED3= B.4
 SYMBOL P7	= C.0		SYMBOL P14 = B.5
 
main:
 
'number1
	high LED1					'turn LED1 on
	pause 50					'pause for 50ms
	if PUSH = on then Shownumber
	low LED1					'turn LED1 off
 
'number2	
	high LED2					'flash LED2
	pause 50
	if PUSH = on then Shownumber
	low LED2
 
'number3
	high LED1, LED2		
	pause 50
	if PUSH = on then Shownumber
	low LED1, LED2
 
'number4
	high LED2, LED3		
	pause 50
	if PUSH = on then Shownumber
	low LED2, LED3
 
'number5
	high LED1, LED2, LED3	
	pause 50
	if PUSH = on then Shownumber
	low LED1, LED2, LED3
 
'number6
	high LED2, LED3, LED4	
	pause 50
	if PUSH = on then Shownumber	
	low LED2, LED3, LED4
 
goto main						'repeat program
 
shownumber:
	pause 5000
	goto main

 

 

Order DicePLATFORM