hi, i have a new camera system that goes onto a livestream for a dated AM radio station. i dont know much at all about programming and would like some help with my code to get this working.
basicly what needs to happen is when certian microphones are on, certian cameras need to be activiated.
all help is welcome and i can give you further info if you need it, Thanks you!
This is my current code:
/*
livestream cam draft
this will switch betweencams facing either the annoucer, guest, news or still screen.
*/
int Cam1 = 3;
int Cam2 = 4;
int NewsCam = 5;
int Mic1 = 8;
int Mic3 = 9;
int Mic4 = 10;
int NewsMic = 11;
int StillScreen = 6;
void setup(){
//set cams and stillscreans to outputs
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
//set mics to inputs
pinMode(8,INPUT);
pinMode(9,INPUT);
pinMode(10,INPUT);
pinMode(11,INPUT);
// Enable internal pull-up resistor
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
pinMode(11, INPUT_PULLUP);
}
void loop()
{
//begin checks for mics
if(digitalRead(11) == HIGH)
{
digitalWrite(NewsCam, HIGH); //turns on cam in newsroom
digitalWrite(Cam1, LOW);
digitalWrite(Cam2, LOW);
digitalWrite(StillScreen, LOW);
}
else if (digitalRead(10) == HIGH)
{
digitalWrite(Cam1, LOW);
digitalWrite(NewsCam, LOW);
digitalWrite(StillScreen, LOW);
digitalWrite(Cam2, HIGH); //turns on guest cam
}
else if (digitalRead(9) == HIGH)
{
digitalWrite(Cam2, HIGH); //turns on guest cam
digitalWrite(Cam1, LOW);
digitalWrite(NewsCam, LOW);
digitalWrite(StillScreen, LOW);
}
else if (digitalRead(8) == HIGH)
{
digitalWrite(Cam1, HIGH); //turns on talent cam
digitalWrite(Cam2, LOW);
digitalWrite(NewsCam, LOW);
digitalWrite(StillScreen, LOW);
}
else (digitalRead(8) == LOW && digitalRead(9) == LOW && digitalRead(10) == LOW && digitalRead(11) == LOW);
{
digitalWrite(StillScreen, HIGH); //turns on stillscreen
digitalWrite(Cam1, LOW);
digitalWrite(Cam2, LOW);
digitalWrite(NewsCam, LOW);
}
}
Moderator edit: tags corrected