I need help to make a code.

Hi all. Can anyone please help me make a code for a rather simple task (I think) :o

I want a led to go on and off, and be able to adjust the "off time" from 0-60sec and the "on time" from 0-10 sec.

The "on time" and "off time" is to be adjusted with 2 ea potensiometers on for "off time" and one for "on time" on the analog input.

I have the arduino uno R3 smd edition board

Show us the sketch you have so far. .

The sketch is probably the textual home-work assignment. Nobody wants to do the described stuff IMHO.

I have no sketch.... And no clue on how to write a code :o :) so i appreciate any help with thanks :)

The IDE comes with some examples. Look at the Analog input example. Then try to write some code using two potentiometers. When you run into problems, post your code here and ask your questions.

Is this fo school? .

Follow this link for some foundations: https://www.arduino.cc/en/Tutorial/Foundations

This is no homework assinment. I want to controll the feed rate on my old grinding machine. And using the arduino+a relay child + the code it woult be a good fix i think , it would be cheaper and simpler than converting the machine to a cnc with sero motors.... only problem is the code... i do not speak this language... :o so can anyone help me..?

If you do not want to learn it, no problem.

See if this fits your needs

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(115200);
}
void loop() {
  static unsigned long lastChange;
  if (digitalRead(LED_BUILTIN)) {
    unsigned long onTime = map(analogRead(0), 0, 1023, 0, 60000);
    if (millis() - lastChange >= onTime) {
      Serial.print(F("on for "));
      Serial.println(onTime);
      digitalWrite(LED_BUILTIN, LOW);
      lastChange = millis();
    }
  } else {
    unsigned long offTime = map(analogRead(1), 0, 1023, 0, 10000);
    if (millis() - lastChange >= offTime) {
      Serial.print(F("off for "));
      Serial.println(offTime);
      digitalWrite(LED_BUILTIN, HIGH);
      lastChange = millis();
    }
  }
}

I got this error
I wierd the potensiometers middel pin on A0 and A1 and side pins on GND and 5v.
And output on 13.

C:\Users\Bruker\Documents\Arduino\sketch_feb20a\sketch_feb20a.ino: In function ‘void loop()’:

sketch_feb20a:24: error: expected ‘}’ at end of input

}

^

exit status 1
expected ‘}’ at end of input

Is it so hard to copy?

:) Thanks its working! :) :) Appreciate it

JRHov