Maker Pro

Christmas Tree Project - PICAXE

A mini Christmas tree decoration created using PICAXE

Supercap2F

Mar 22, 2014
550
Joined
Mar 22, 2014
Messages
550
Supercap2F submitted a new Showcase Item:

Christmas Tree Project - PICAXE

Hello Everyone! :)

Christmas time is coming! So I created a mini Christmas tree decoration to be a gift. It has four modes:

  • It plays a strip of lights rotating around the tree.
  • It alternately plays the lights flashing on it.
  • It selects a random (kind of) light to flash.
  • It selects a random (also kind of) strip and then plays the LEDs on it one by one.

The modes are selectable by the switch 'S1' on the schematic. The switch 'S2' and the pot 'R11' are for adjusting the flash rate. You turn the pot and then press 'S2' and it loads a new flash rate to the current mode playing (it only adjusts the current mode playing). It uses the PICAXEs EEPROM, so once you turn it off it does not forget the mode it's playing or the flash rate for any of the modes (so when you start it back up it will be playing the same mode as when you turned it off). Here's the schematic:


and Here's the code:
Code:
;***********************PIN_LAYOUT************************;
;*  || Pin____Grid__No._GNo._||__Pin___Grid_No._GNo._||  *;
;*  || C.0 -> column 1   01   ||  B.3 -> row 1   05   || *;
;*  || C.1 -> column 2   02   ||  B.4 -> row 2   06   || *;
;*  || C.2 -> column 3   03   ||  B.5 -> row 3   07   || *;
;*  || C.4 -> column 4   04   ||                      || *;
;*********************OTHER_PIN_LAYOUT********************;
;*  || Pin____Function_______||__Pin____Function_____||  *;
;*  || C.3 -> Mode switch    || B.2  -> Set Speed    ||  *;
;*  || B.1 -> ADC            ||                      ||  *;
;*********************************************************;
;*_________________________Grid__________________________*;
;*           01    02    03    04                    *;
;*               LED---LED---LED---LED 05                *;
;*           LED---LED---LED---LED 06                *;
;*           LED---LED---LED---LED 07                *;
;*                                             *;
;* Logic 0 selects each channel                          *;
;*********************************************************;


;**************************MAIN***************************;
;* The main code block checks the mode switch and stores *;
;* its last state in the on board EPROM. It also executes*;
;* the correct pattern.                                  *;
;*********************************************************;
main: ;this is to make all the variables equal zero (only done once)
    setfreq M32 ;set the PICAXE chip...[/quote]

[url=https://www.electronicspoint.com/projectlogs/christmas-tree-project-picaxe.2/]Read more about this showcase item here...[/url]
 

Attachments

  • CTREE_10_23_14__2.txt
    9.4 KB · Views: 101
Top