Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[Moved] LPC2138 PWM to control servo motor

Status
Not open for further replies.
You get a blank result even after using
Code:
angle= 123.4567;

What is the content of buffer array when you reach the lcdputs line?

PFA content OF BUFFER ARRAY buf.png

- - - Updated - - -

You get a blank result even after using
Code:
angle= 123.4567;

What is the content of buffer array when you reach the lcdputs line?

PFA content OF BUFFER ARRAY buf.png
 

This can't be the result of
Code:
angle= 123.4567;   // add this before sprintf to see if you get output
sprintf (buffer, " adc %0.4f", angle);

The value is different and the adc letters are missing from the array
 

This can't be the result of
Code:
angle= 123.4567;   // add this before sprintf to see if you get output
sprintf (buffer, " adc %0.4f", angle);

The value is different and the adc letters are missing from the array
no i changed the code value is correct i assigned as
Code:
                              angle =1.2356;
					sprintf (buffer, " %0.4f", angle);
					lcdputs(buffer);
 

The sprintf conversion is correct so I can only blame the LCD functions, I have no idea why it works in some cases and not in others
 

The sprintf conversion is correct so I can only blame the LCD functions, I have no idea why it works in some cases and not in others
But lcd function works for some cases it display %d, %x ..... But if I use %f lcd just blinks. ... Whether the value has to converted to any other form ?
 

This is not related to the sprintf operation, sprintf converts the float value and the array content becomes " 1.2356" , it the LCD function that for some reason can't show this.
Unless sprintf usage affects the operation of the code and messes it up, I'm not sure how.
 

This is not related to the sprintf operation, sprintf converts the float value and the array content becomes " 1.2356" , it the LCD function that for some reason can't show this.
Unless sprintf usage affects the operation of the code and messes it up, I'm not sure how.
any changes to be made in lcd function ?
 

Can't help you with that.
My suggestion is either to search for a LCD library for your device or get one for AVR or PIC and modify it.
 

Can't help you with that.
My suggestion is either to search for a LCD library for your device or get one for AVR or PIC and modify it.
ok let me google it. mean while if you find any any sort of material for that ,post the link.

thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top