Arduino Programming error?

Hello,

I have made program which should show me 255 codes on a LCD display of 40*2

After programming them with my code the most weird text is showing up. when making the code smaller: up to 180 codes, it suddenly works fine...

Can some1 help me with this problem?

Code up to 180 codes:
http://www.text-upload.com/read.php?id=71938&c=3854221

Code up to 250 codes
http://www.text-upload.com/read.php?id=71941&c=5388691

You must really, really like typing.

// Print error Code 20 
if ( B == 20){ 
lcd.setCursor (0 , 0 ); 
lcd.print("Error 01"); 
lcd.setCursor (0 , 1 ); 
lcd.print("Code 020"); 
C = 20;} 

// error Code 20 Printed 

// Print error Code 21 
if ( B == 21){ 
lcd.setCursor (0 , 0 ); 
lcd.print("Error 01"); 
lcd.setCursor (0 , 1 ); 
lcd.print("Code 021"); 
C = 21;} 
// error Code 21 Printed
while(A == 5 ){

// about 1500 lines of mumbo-jumbo which does not change A

A = 10;

} // End A == 5

This is a joke, right?

What is the purpose of it?

Do you think this would make your sketch any shorter?

  int hundreds = B / 100;
  int tens     = (B % 100) / 10;
  int units    = B % 10;

Well i learned to write HTML and JAVA so the code just pops out.

Its for a error display on my installation.

The loop works fine, but the text on the display with the 255 codes is showing:

226
227

Which never get defined.

Let's hope your code doesn't have to do much else than display error messages:

Binary sketch size: 27450 bytes (of a 32256 byte maximum)

That's 85% of your program memory gone already.

Grootvalk:
The loop works fine, but the text on the display with the 255 codes is showing:

226
227

Which never get defined.

I didn't understand that bit.

Grootvalk:
... when making the code smaller: up to 180 codes, it suddenly works fine...

Yes, well make the code smaller. Here's a tip ... You have this 255 times:

if ( B == XXXX){ 
lcd.setCursor (0 , 0 ); 
lcd.print("Error 01"); 
lcd.setCursor (0 , 1 ); 
lcd.print("Code XXXX"); 
C = XXXX;}

Do you think you might be able to reduce that to doing that part once?

It acts like a converter of my PLC which sends a byte to my Arduino Nano, Which will be converted from 24V to 5V using 78L05Z and a optocoupler.

The remaining program memory is for editing the text to be shown.

when uploading the 255 code viewer i get:

Upperline 226
Lowerline 227

And when throwing Bit 0 tot he ground 227 = 227 + 1
And when throwing Bit 1 tot he ground 227 = 227 + 2
And 226 just stands there... but there should always stand "error 01"

The code cant get smaller because my HTML script is able to change "lcd.setcursor( 0,0 ) to the range of 0-1,0-39

The code cant get smaller because my HTML script is able to change "lcd.setcursor( 0,0 ) to the range of 0-1,0-39

It can get a lot smaller.

AWOL:

The code cant get smaller because my HTML script is able to change "lcd.setcursor( 0,0 ) to the range of 0-1,0-39

It can get a lot smaller.

only the set.cursor for the upperline when not defined, but it wont need to get smaller, it just needs to work..
Its strange that up to 180 it works great and any higher and it fails..

i can not do this part once, because they can all be different.
And a HTML form creates everything for me.
cant this problem be fixed?

You seriously, seriously need to revisit how variables work. The places you used them, like here:

while(A == 5 ){

...

A = 10;

} // End A == 5

... don't make any sense. That "loop" will only execute once. Why have the "while"?

And what the heck are A, B, C? How about names that give a clue as to their purpose?

And then when you could use a variable to reduce 1500 lines of code to 10 you say you can't do it.

The code cant get smaller because my HTML script is able to change "lcd.setcursor( 0,0 ) to the range of 0-1,0-39

Do you mean, the HTML script is going to change the Arduino sketch, and then re-upload the changed sketch, on-the-fly in some bizarre way?

And a HTML form creates everything for me.

Hmm, I think you do mean that.

Grootvalk:
The code cant get smaller because my HTML script is able to change "lcd.setcursor( 0,0 ) to the range of 0-1,0-39

It could still output: lcd.setcursor( x,y )

or does each error message appear in a different location?

The HTML thing is for real. check ImageShack - Best place for all of your image hosting and image sharing needs

A = Meant for the steps, Convert the Inputs to 0-255, which gets to "B"
When the error code for B is printed B = C

When B != C a new message gets printed on the LCD

and afterwards a LED wil flash which is currently removed.

and the text will get centered in the midle of the LCD, so it gets different yes.

and the text will get centered in the midle of the LCD, so it gets different yes.

I think you may have got into an HTML, not programming, mindset.

Well i have to make this and it should work!

But i think i got the problem

Arduino Uno
An ATmega328 running at 16 MHz with auto-reset, using the optiboot bootloader (115200 baud, 0.5 KB).

When checking in Bascom AVR what the error rate is.. it is almost 8%.

Can i change it somewhere?

I do an Electric, Installatin, Designer and construction education.

Now i have to work for my education and get to learn more than i need.

so ive created all this for an easy work and everyone can program.

so ive created all this for an easy work and everyone can program

Imagine how much more work you could get done, if you didn't have to do all that typing.

I only have to change some values in the HTML page and simply press convert and done.

But i cant get it right now, cus it fails.