How can I manage the information from a sensor photoresistor in arduino?
Im making a project trying to get information from 3 sensors in arduino (photoresistor). if they activate in certain order unity does something. They way Im recieving the information is constant, if sensor one activates i recieve a string "1" and i recieve it like a million times and i cant make a pattern. I have a horrible code with ifs but ill make a co routine. void ShowVideo(string Direction) {
print(Direction);
//aqui poner si el arduino manda señal 1 reproducir video de le atinaste
//si manda 2, esperar un rato y despues que reprodusca video de fallar
if (Direction == "1")
{
//salen efectos positivos
//y sale frase seleccionada de la lista positiva
print("mensaje positivo");
text.text = "mensaje positivo";
listen = false;
}
if (Direction == "2")
{
//salen efectos negativos
//sale frase negativa de la lista negativa
//sale la frase de "Pero no dejes de intentarlo"
print("You miss, try again");
text.text = "You miss, try again";
listen = false;
}
if (Direction == "3")
{
//te regresa al menu principal
print("Apunta tu varita");
text.text = "Apunta tu varita";
}
Your answer
Follow this Question
Related Questions
Arduino PIR sensor to unity 1 Answer
Read multiple sensor values independently from arduino to unity 2 Answers
Not Fully Understanding how To Correctly Receive LDR Arduino Data 0 Answers
Change Value Of UI Light Slider to Read At Specific Points Of Slider Value 1 Answer
how can I make a sensor in unity ?,how can I make a distance sensor in unity ?, 1 Answer