Help with code In return a box of Components as a thank you

this code i have works perfectly part from 2 things. firstly the text on the lcd flashes when the text changes.
you can see that the number flashes once when the text changes.
video here of what i mean
View My Video

second problem is
i want this part of the code

WARNING
AC Mains Power Fail
Battery Backup On
12v

to show up on the screen when a LDR 5537 is activated by light and message goes off when no light.

First person to take my code and fix it i will send you a box of components FREE! ill even pay postage
UK/USA anywhere really long as its on this planet :smiley:
hole range of components from lcd's to battery holders and resisters,leds and so on
i will simply take 2 of each component i have till the box is full

unRaidLCDv7.ino (14 KB)

I'd consider your offer, except that your code is fill of crap like this:

      for (uint8_t i=0; i<NUMADC; i++) { getVal(i); if (sensors[i].alarm!=0) { j=i; break; } }  // Check if any of the alarm bits are set

You are not charged more for using the enter key. So, use it more.

The code does something. You didn't say what.
You want it to do something. You weren't clear on what.

I Dont know what you are asking me.. the code is full of comments that clearly explain what each part does. now im no code expert but im pretty sure anyone that knows how to code can look at this code and understand it .
however this code was written by someone with 11 years programming experience as a job.

I have to agree with PaulS about the coding style. I know I sure won't spend an hour formatting it into a readable state.

lar3ry:
I have to agree with PaulS about the coding style. I know I sure won't spend an hour formatting it into a readable state.

You must be a very slow typist if it takes you an hour to hit Ctrl + T.

Henry_Best:
You must be a very slow typist if it takes you an hour to hit Ctrl + T.

That fixes some of it. If the OP can't be bothered to format it, that's his problem.

This here, is what is causing your numbers to flash.

for (uint8_t i=0; i<NUMADC; i++) {
lcd.setCursor(sensors_.txtx,sensors*.txty);_
_ lcd.print(sensors.txt);
}[/quote]
And this is because of the blank space in your text, in the sensor array, " CPU ", " SYS ", "PARITY ", " DRIVE "
To solve this issue, you can add a lockout variable called shown, like so.
*_</em> <em><em>*if(!shown) // if this text has not been shown on the display, show it, otherwise skip this part.   {     for (uint8_t i=0; i<NUMADC; i++) {       lcd.setCursor(sensors[i].txtx,sensors[i].txty);       lcd.print(sensors[i].txt);     }     shown = true; // this means the text in already on the display, so set the variable true, to skip this section.   }*</em></em> <em>_*_
Now this will change when your warning screen is shown, so when the warning screen goes away, you need to set shown back to false, otherwise the code will think the text is already on the screen when it is not.
Add shown = false; here in the warning section.
> for (uint8_t l=0; l<(1000/30); l++) // 1 second silence*

> {
> analogWrite(LEDPIN, brightness); // set the brightness of pin 9:
> brightness = brightness + fadeAmount; // change the brightness for next time through the loop:
> if (brightness == 0 || brightness == 255) fadeAmount = -fadeAmount ; // reverse the direction of the fading at the ends of the fade:
> delay(30); // wait 30 milliseconds
> }
> shown = false;
Aside from all the delays and the few useless FOR loops, it should work. You could also write the code a whole lot better by taking out all the delays and use IF statements to see if a certain time interval has past. Look into the Blink Without Delay example sketch.

i am new to arduino and writing code. this is why i asked for help and in return for helping me ill return the favore and send you some components free as a thank you

i dont understand why people are having a pop at me for not knowing how to write code.
if i knew how to write code i wouldn't be on here asking for help and offering to pay with components

if anyone is offended by me asking for help then please do not comment

There is another section of the forum called Gigs and Collaborations for projects that are paid for. Maybe you should ask the moderator to move this Thread there.

In this section of the forum it is assumed that people want to learn how to write Arduino code; that they are prepared to put in some effort themselves and that they have worked through several of the example sketches that come with the Arduino IDE.

You can't expect anyone to spend more than about 5 minutes reading and replying to your questions so make it as easy as possible for them to give you some useful feedback.

And people that give assistance here are quite happy to do so free of charge.

...R