===================================================================================
===================================================================================
--------------------------------------------------------------------------------------------------------------------------------------------------
UPdate
// Output
int audioPin = 11;
int s= 0;
int s2= 3;
int s3= 5;
int f=0;
int f2=0;
int f3= 0;
int sound= 0;
int sound2= 0;
int sound3= 0;
int sound_out = 0 ;
int dir1 = 1;
int dir2 = 1 ;
int dir3= 1;
void setup()
{
pinMode(audioPin, OUTPUT);
pinMode (s, INPUT);
pinMode (s2, INPUT);
pinMode (s3, INPUT);
}
// Main program
void loop()
{
f=analogRead(s);
f2=analogRead (s2);
f3 =analogRead (s3);
sound= sound + dir1 * 2 ;
sound2= sound2 + dir2 * 85 ; sound3 =sound3+ dir3 * 8;
if (sound > 85) {
dir1 = -1;
sound = 85 ;
delay(654/2);
}
if(sound2 > 85) {
dir2 = -1 ;
sound2 = 85 ;
}
if (sound3 > 85) {
dir3= -1;
sound3 = 85;
}
if (sound < 0) {
dir1 = 1;
sound = 0 ;
}
if (sound2 < 0) {
dir2 = 1 ;
sound2 = 0 ;
}
if (sound3 < 0){
dir3 = 1;
sound3 =0;
}
sound_out = 0 ;
if (f < 80)
sound_out += sound ;
if (f2 < 80)
sound_out += sound2 ;
if (f3 < 80)
sound_out += sound3;
analogWrite (audioPin, sound_out);
}
---------------------------------
+++++++
______________________________________
konstfacks' transformation/s.20.06.05
______________________________________
---------------------------------
May 2006 /
June 2006 /
---------------------------------
Blogger
---------------------------------