# Print\_long() displays garbage?

**URL:** https://forum.pololu.com/t/print-long-displays-garbage/1634
**Category:** Software and microcontrollers
**Created:** [November 22, 2009, 7:36am UTC](https://forum.pololu.com/t/print-long-displays-garbage/1634 "2009-11-22T07:36:06Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![ashtangakasha](https://forum.pololu.com/user_avatar/forum.pololu.com/ashtangakasha/32/132_2.png) [@ashtangakasha](https://forum.pololu.com/u/ashtangakasha)
#### Post date: [November 22, 2009, 7:36am UTC](https://forum.pololu.com/t/print-long-displays-garbage/1634/1 "2009-11-22T07:36:06Z")

</div>

I decided to restore the demo program in an Orangutan SV328 w/LCD.

I found this project:

libpololu-avr\examples\atmega328p\SV-xx8\_demo\_program\SV-xx8\_demo\_program.aps

It appears to work on LEDs and beeps (not tested on motors), but the millivolt display routines are displaying garbage. For example:

```c
// Displays the battery voltage.
void bat_test()
{
	int bat = read_battery_millivolts_sv();

	print_long(bat);
	print("mV");

	delay_ms(100);
}

```

The pot demo also displays garbage, as does the VBAT display in the quick demo mode.

My instincts tell me that print\_long() should not be passed an int, but there seems to be no other way to convert a number to a string in the lib, and it’s done consistently throughout the demo code. I have tried printing ints with values I have assigned, and they display correctly.

I’ve tried quite a few variations on the analog read functions, but all the print\_long() statements result in garbage (e.g., “1?] 4V”).

Any insight into what I’m doing wrong would be much appreciated. Or perhaps a link to the latest demo source that’s preloaded into the controllers.

Thanks in advance,

Allen

---

_[View the full topic](https://forum.pololu.com/t/print-long-displays-garbage/1634)._
