Pic Code Convert to Arduino

Hi
Any one can help me?

Convert my Pic Code for Arduino UNO board.

pleas help me.:sob:

i attach my pic code as .c file.

Final Code With New Timer_452.c (18.1 KB)

This pic code using for small timer
the timer have a Ds18b20 temperature sensor.
Any one can help me for convert this code to arduino UNO board.

I weep when I read code like this

      if(Set_Temperature<temp_range[4] && index==7){  // 80=range 30 50  70
        on_delay_temp=on_delay[4];
        off_delay_temp=off_delay[4];
      }

      if(Set_Temperature<temp_range[3] && index==7){  //  60=range  30 50  70
        on_delay_temp=on_delay[3];
        off_delay_temp=off_delay[3];
      }
      if(Set_Temperature<temp_range[2] && index==7){  // 80=range 30 50  70
        on_delay_temp=on_delay[2];
        off_delay_temp=off_delay[2];
      }

      if(Set_Temperature<temp_range[1] && index==7){  //  60=range  30 50  70
        on_delay_temp=on_delay[1];
        off_delay_temp=off_delay[1];
      }

      if(Set_Temperature<temp_range[0] && index==7){ // 40=range  30  50  70
        on_delay_temp=on_delay[0];
        off_delay_temp=off_delay[0];
      }

Do you have the original specification?

AND DO NOT CROSS-POST, CROSS-POSTING WASTES TIME.
Duplicate deleted.

Hi Dear
Thank for your reply.
This is the my pic code story
it is timer with ds18f20 temperature sensor
the timer control 12v dc motor

i can set on time and off time in 5 way
lick this
temp=120 F’(on time=5s/off time =10s)
temp=140 F’(on time=10s/off time=7s)

also it run with set temperature

if set temperature is 120 F’
the timer run till 120 F’ measure temperature

if on time is 5s dc motor on time is 5 second

can you give me any idea for writing Arduino code.
i converted it but not working it.
pleas check it.

Final_CountDown_Timer.ino (15.7 KB)

libraries.zip (456 KB)

pleas any one reply to me.
how to use timer for this code part in arduino

#int_TIMER1
void TIMER1_isr(void)
{

set_timer1(3036);
sec_2++;
if(sec_2==2)
{
sec_2=0;
sec_pointer++;
second++;
//if(timer_mode==1)
second1++;
if (Second1 == 60) {Minutes++; Second1=0; change=1;
if (Minutes == 60) {Hours++; Minutes=0; change=1;
//if (Hours == ) { Hours=0;

}
}

float temp_c(){
  float c;
  c = sht1x.readTemperatureC();
}
float temp_f(){
  float f;
  f = sht1x.readTemperatureF();
}

What's the point of that?

i converted it but not working it

What does that mean?

sorry
it is my new temperature and Humidity reading sensor point(sht11 sensor)

i running this code in my arduino board

display is ok
temperature reading is ok
but timer not working
button is ok

i can't set any on time or off time.

Can you give me your skype name i can see my arduino board ?

sasika:
Can you give me your skype name i can see my arduino board ?

Nope

    index=8;

    switch(index)

What's the point of that?

        while(key==4);

That could be quite some time.

it is ok.

Please check my code and reply to me.Thanks

AWOL:
Nope

    index=8;

switch(index)



What's the point of that?

the point is in switch function call for case 8:

for system stop

AWOL:
Nope

        while(key==4);

That could be quite some time.

not it not working

can you give me some example code for the timer with set more function for set on time and off time

Why not stop and think what your code is doing at the moment?
Within "loop()" you have another infinite loop and just about the first thing you in that loop is assign 8 to the variable "index."
Then you have a switch on "index", so which case does it always execute?

Even if you did do something different, the code is peppered with stuff like

      while(key==1);
      while(key==2);
  • what's the point of those? They'll stop your code dead forever if they're true.