HauntForum
 
 
 


Go Back   HauntForum > Props and Prop Building > Technological Terror

Notices

Technological Terror For the discussion of items of technology such as motors, controllers, motion sensors, audio boards etc. Also to discuss how to hack commercial electronic props.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-27-2007
Garage-Of-Evil's Avatar
Garage-Of-Evil Garage-Of-Evil is offline
Desensitized
 
Join Date: Jul 2007
Location: Providence, RI
Posts: 157
Likes: 0
Liked 1 time in 1 post
Default Prop1 program - New take on some fire flies

This is a different take on JonnyMac's very cool "fire flies" code. The intent of this version was to randomize the PWM ramp-up and down times to make the fireflies more natural. The "playlist" was also removed.

For those not familiar with this program, the use is simple. Run a bunch of grain-of-rice LED's off the Prop-1 5V pins, and arrange them in such a way so that a slight breeze, or perhaps even an FCG type mech makes the LED's move. The program then randomly lights the "fire flies". Very cool effect!


' ================================================== =======
'
' File: fire_flies2
' Purpose: A different take on the "fire flies" LED program
' Author: Steve O'Connor
' E-mail: steveo@garageofevil.com
' Started: August 27, 2007
' Updated: N/A
'
' {$STAMP BS1}
' {$PBASIC 1.0}
' {$PORT COM1}
'
' ================================================== =======


' -----[ Program Description ]---------------------------------------------
' My version of JonnyMac's very cool fireflies program. The intent of this
' version was to randomize the PWM ramp-up and down times to make the fireflies
' more natural. The "playlist" was also removed.

' -----[ Revision History ]------------------------------------------------
' N/A
' -----[ Variables ]-------------------------------------------------------

SYMBOL Bug = B2
SYMBOL Lottery = W5
SYMBOL Brightness = B4
SYMBOL PINCheck = B3
SYMBOL WaitTime = W6
SYMBOL Duration = B1
SYMBOL Duration_Stir = B8
SYMBOL Startdur = B7



' -----[ Program Code ]----------------------------------------------------

Main:

FOR Duration_Stir = 1 TO 10 'Stir the variables up

RANDOM Duration
RANDOM startdur
RANDOM Lottery
NEXT

Bug = Lottery // 6
Startdur = Startdur // 255
Duration = Duration // 256 + 150

IF PINCheck = Bug THEN Main 'Don't light the same Bug
'twice in a row

FOR Brightness = Startdur TO Duration STEP 1 'Light the Bug
PWM Bug, Brightness, 1
NEXT

HIGH Bug
PAUSE 300

FOR Brightness = Duration TO Startdur STEP -1 'Fade the Bug
PWM Bug, Brightness, 1
NEXT

RANDOM Lottery 'Stir Lottery again
WaitTime = Lottery // 250 + 500 'Use Lottery value for the
PAUSE WaitTime 'time between Bugs being lit

PINCheck = Bug 'Remember which Bug lit last

GOTO Main



' -------------------------------------------------------------------------
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New to the prop1 slimy Technological Terror 0 02-05-2007 04:53 PM
Man starts fire by roasting bear Johnny Thunder Oddities 0 09-12-2006 11:17 AM
a free planitarium program for PC HibLaGrande Off-Topic 3 08-09-2006 10:59 PM
Prop re-creation Dr Morbius Pneumatics 43 08-09-2006 12:30 AM
fog machines and the fire Dept krough Atmosphere 10 07-13-2006 03:33 PM



All times are GMT -4. The time now is 04:41 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
© 2004 - 2011 HauntForum.com | All rights reserved