[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4752: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4754: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4755: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
OUPower.com • View topic - OT electronics question

OT electronics question

Here we will discuss many topics on electronic designs and circuits for various functions. PIC Chip programming has enormous potential in so many applications, that will be included in this forum as well.

OT electronics question

Postby Brett » Fri Aug 31, 2007 10:21 am

Hi guys

quick question for you, im designing a circuit that needs part of it to randomly switch on one of 4 inputs from a trigger switch. been out the electronics industry a while now and even when i was in it i never had a need for anything like this, is there an IC that i can use for this?


Cheers in advance


Brett
Brett
Regular Poster
 
Posts: 24
Joined: Sun Mar 13, 2005 5:15 pm

Postby Brett » Fri Aug 31, 2007 3:37 pm

i didnt see an edit tab to edit my above post.


For example i have a pir sensor and i want it to play 1 of 4 seperate sound recordings in a random order..


Just thought maybe my post might not have been so clear after i re-read it
Brett
Regular Poster
 
Posts: 24
Joined: Sun Mar 13, 2005 5:15 pm

Postby AlaskaStar » Sun Sep 02, 2007 3:10 am

Use this:

10 @Rand=A
20 A(10)=B
30 If B<2.5 Then Goto 100
40 If B>2.5<5 Then Goto 200
50 If B>5<7.5 Then Goto 300
60 If B>7.5<10 Then Goto 400
100 Play (SongFilename1.SND)
110 GOTO 10
200 Play (SongFilename2.SND)
210 GOTO 10
300 Play (SongFilename3.SND)
310 GOTO 10
400 Play (SongFilename4.SND)
410 GOTO 10


The above is a general syntax command line similar for Apple, GwBasic, QBasic, Basica, DOS Batch File, or anything else applied. uses similar in the TI-81, TI-82, and TI-83 Texas Instrument Calculators.

Oh! and don't have too much fun with this.

the Rand statement means to generally generate a RANDOM NUMBER. this number will be LESS THAN ONE. it will be like 0.125 or 0.750, and will usually be in divisions of 8ths from 1. this gives you a spread of 8 randoms. they will almost never be the same random number output.

AlaskaStar
"Do we exist, or are we just an existence?"
User avatar
AlaskaStar
Regular Poster
 
Posts: 1044
Joined: Sun Jul 03, 2005 4:48 am
Location: Alaska


Return to Electronics, Circuits & PIC Chips

Who is online

Users browsing this forum: No registered users and 5 guests

cron