• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by AbiSaenz9 · Apr 03, 2018 at 01:38 AM · arduinosensor

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";
     }
    
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

130 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

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

Arduino PIR sensor to unity 1 Answer

how is the Input.compass.rawVector affected by a magnet? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges