Please post your code with code tags.. Like this:
int potMin = 0; // potentiometer minute time
int potHours = 1; // potentiometer hours time
int ledMin = 12; // select the pin for the minute LED
int ledHours = 11; // select the pin for the hours LED
int Minute = 0; // variable to store the value coming from the sensor
int Hours = 0; // variable to store the value coming from the sensor
void setup() {
pinMode(ledMin, OUTPUT); // declare the ledPin as an OUTPUT
pinMode(ledHours, OUTPUT); // declare the ledPin as an OUTPUT
Serial.begin(9600);
}
void loop() {
Minute = analogRead(potMin); // read the value from the Minute sensor
Hours = analogRead(potHours); // read the value from the Hours sensor
Serial.print("Min sensor = "); // print the value from the Minute sensor
Serial.print(Minute);
Serial.print("\t Time in min = "); // print the convertion in minuts
Minute = map( Minute, 0,1023, 10000, 122400); // 2 minut max so 0 will be 10 secound and 1020 will be 2 min .
Serial.println(Minute);
Serial.print("Hours sensor = "); // print the value from the Hours sensor
Serial.print(Hours);
Serial.print("\tTime in hours = "); // print the convertion in hours
Hours = map( Hours, 0, 1023,1841400,22096800 );
Serial.println(Hours); // 1841400 is equal to 30 minutes and 22096800 is equal to 6 hours.
Serial.println(" ");
digitalWrite(ledMin, LOW); // turn the led min ON
digitalWrite(ledHours, HIGH); // turn the led hours OFF
delay(Minute);
digitalWrite(ledMin, HIGH); // turn the led min OFF
digitalWrite(ledHours, LOW); // turn the led hours ON
delay(Hours);
}
Arduino is 16bit, numbers like "1841400" does not fit in 16 bit (65535 unsigned max). You need to specifically tell the compiler to use longs, or even better - declare them as constants:
//Using constants
const long HOUR_MIN = 1841400;
const long HOUR_MAX = 22096800;
...
Hours = map( Hours, 0, 1023, HOURS_MIN, HOURS_MAX);
...
//Using inline declarations
Hours = map( Hours, 0, 1023, 1841400L, 22096800L); //Note the "L"