servomotor with photoresistor

hey guys, I have a question, I have a circuit that is a led and a photoresistor, and I will place it on one finger, and as I bend it and as the photoresistor is receiving light, the servomotor will be moving at the same time that the photoresistor is receiving light.How can I do that? I’ve checked that values of the photoresistor when the light is approaching and the values go from 700 to 200 more or less.
#include <Servo.h>
Servo servo1;
int photores=A0;
int posicion=700;

void setup() {
// put your setup code here, to run once:


void loop() {
// put your main code here, to run repeatedly:

map( 0,1023, 0, 179);

I tried to use it with a for or if statement, but I am not sure how to

That code, which doesn't even compile, gives no real idea of what you're trying to do.

You read a value from A0, print it and then, ignoring that value, change it to 750 in the for statement. Why? And then you write a fixed value to the servo. It makes no sense.

Try a better explanation of what you want to do concentrating on how the different values from the photoresistor should affect the servo. E.g. when photoresistor reads 200 where should the servo be, when it reads 400 where now etc?


Why didn't you continue in ??

Ah, I see. You did not even read the replies there, else you would have posted your code correctly.