Making small pic code for inside while(1) loop

Job ID: 31708915

Budget: ₹600 – ₹1,500 INR

I am using code like this
A sytem on at x1>45 RC1 =0
If x1 <= 45 RC1=1

But i want code goes like this

47 RC1=0 OFF
46 RC1=0
45 RC1=0
44 RC1=0
43 RC1=1 ON
42 RC1 =1
41 RC1=1
40...0 RC1=1
Then if value increase
41 RC1=1
42 RC1=1
43 RC=1
44 RC=1
45 RC=0 OFF
46......100 RC1=0
Then again if value start decreasing
45 RC1=0
44 RC1=0
43 RC1=1 ON
43.....0 RC1=1
Related categories: C Programming Microcontroller