andyowenwest:
Hi,
First off, a little more context is needed. When you refer to flip-flop I assume youre not referring to a logic flip flop (i.e JK / SR)
Secondly please put your code in the code brackets as its much easier to read
This is my best attempt at something to help you in the right direction. But really a little more context is needed i.e. what is this for, why the two different times.
A schematic always helps! 
Andy
#define forward 5;
#define reverse 4;
#define pot_pin 0;
void setup(void);
void loop(void);
void read_pot(void);
int time_1 = 120000;
int time_2 = 5000;
// the setup function runs once when you press reset or power the board
void setup()
{
pinMode(forward, OUTPUT);
pinMode(reverse, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
read_pot();
digitalWrite(forward, HIGH);
delay(time_1);
digitalWrite(forward, LOW);
delay(time_2);
digitalWrite(reverse, HIGH);
delay(time_1);
digitalWrite(reverse, LOW);
delay(time_2);
}
void read_pot()
{
float reading = (float) analogRead(pot_pin); //number between 0 and 1023;
reading/=1023;
reading*=120000; //scale up to 0 - 120000;
time_1 = (int)reading;
return;
}
hi thanks for the replay, and sorry about the code not in the correct place :).
the purpose is to control a single phase AC motor rotation (fw and rev) with a delay (5sec) each fw/rev action to protect the motor, motor need a break delay for a mechanical thing (release the contact of the starting capacitor).
each pin (fw and rev) will be control a relay, and each relay will be correspondence to a motor direction and it's work alternately . for a moment I have only one FIX timing which is 1 minute. I need to be able to make it more flexible with an pot to adjust the timer to suit with my need.
I hope my above explanation is represent the situation.
also try to compile above code and get as bellow
exit status 1
expected ')' before ';' token
any advice, really new to these and only have a few soldering skill 