I succeeded in controlling a servo motor using the example code of the software.
Now i bought myself a fototransistor and i would like to use it to control the servo with the arduino chip (UNO) (for example a lot of light means go to 45 degrees/no light go to 0).
Does anyone know how to use the output of the fototransistor so i can use this to give the servomotor an input of 0-180?
Connect the phototransistor between pin A0 and +5V. Connect a resistor between A0 and Ground. Use analogRead(A0) to get values. Figure out the range of values you get. In loop(): Read a value, map the value to the range 0 to 180 using the map() function, and move the servo to that position.