The LCD library doesn't work

I have this setup:
-Pololu 3pi robot
-Atmel Studio 7
-The library installed
-This code[code]
#define F_CPU 20000000 // AVR clock frequency in Hz, used by util/delay.h
#include <avr/io.h> //automatically included
#include <util/delay.h> //automatically included
#include <pololu/3pi.h> //Everything that could POSSIBLY contain LCD control methods included.
#include <pololu/orangutan.h>
#include <pololu/lcd.h>
#include <pololu/OrangutanLCD.h>
//My code-doesn’t work
/int main(){
print(“Pololu 3pi robot”);
_delay_ms(1000);
print(“Hello world program”);
red_led(128);
green_led(128);
//while(1){
red_led(10);
//}
}
/
//Code pasted from the Pololu Library Documentation[/i]-Doesn’t work :?:
/*

int main()
{
while(1)
{
print(“Hello”); // display “Hello” at (0, 0), a.k.a. upper-left
_delay_ms(200);
lcd_scroll(LCD_RIGHT, 3, 200);// shift the display right every 200ms three times
clear(); // clear the LCD
lcd_goto_xy(3, 1); // go to the fourth character of the second LCD line
print(“Hello”); // display “Hello” at (3, 1), a.k.a. lower-right
_delay_ms(200);
lcd_scroll(LCD_LEFT, 3, 200); // shift the display left every 200ms three times
clear(); // clear the LCD
}

return 0;
}[/code] :imp: :imp: :imp:
I am trying to use the library to print stuff to the LCD.
Everything happens EXCEPT LCD control, that generates an error.

Please :imp: :imp: :imp:

[quote]Everything happens EXCEPT LCD control, that generates an error.[/quote]Do you expect forum members to guess what that error might be?

The LCD library works fine for me.

Hello.

Can you post a screenshot of the error message you are getting? Have you tried running the original LCD example? If so, did that example work for you?

- Amanda

Hi, I was running the original example; my code was in a comment. I do not know how to post screenshots.

The code you posted is not the original LCD example code. I just noticed in your code you have underscores before delay_ms, which is different from the original code and probably causing the issue (your commented code also contains _delay_ms()). Again, can you try running the LCD example without any modifications?

To take a screen capture on a Windows system, please see this tutorial. If you have a different system, I suggest searching on the Internet for “how to take a screen capture on [name of operating system you are using]”.

- Amanda

[quote=“AmandaS”]The code you posted is not the original LCD example code. I just noticed in your code you have underscores before delay_ms, which is different from the original code and probably causing the issue (your commented code also contains _delay_ms()). Again, can you try running the LCD example without any modifications?

To take a screen capture on a Windows system, please see this tutorial. If you have a different system, I suggest searching on the Internet for “how to take a screen capture on [name of operating system you are using]”.

  • Amanda[/quote]

Thanks. I will post screenshots next time I work on this.

Hello, Kaboom.

I do not understand your seemingly random “Potato” quote, but this kind of thing is distracting, and it is making it very hard to take you seriously. This is becoming a pattern with you, and if you cannot keep your inquiries on topic going forward, we will have to ban you from the forum.

-Jon

[quote=“JonathanKosh”]Hello, Kaboom.

I do not understand your seemingly random “Potato” quote, but this kind of thing is distracting, and it is making it very hard to take you seriously. This is becoming a pattern with you, and if you cannot keep your inquiries on topic going forward, we will have to ban you from the forum.

-Jon[/quote]
Sorry about that. I love potatoes! They are delicious. I have deleted the “Potato!” quote. I won’t do it again.

I am posting on behalf of my personal friend, kaboom, who was banned.
Just like Amanda suggested, he deleted the underscores.
Here is his code: [code]
#define F_CPU 20000000 // AVR clock frequency in Hz, used by util/delay.h
#include <avr/io.h>
#include <util/delay.h>
#include <pololu/3pi.h>
#include <pololu/orangutan.h>
#include <pololu/lcd.h>
#include <pololu/OrangutanLCD.h>
/int main(){
print(“Pololu 3pi robot”);
_delay_ms(1000);
print(“Hello world program”);
red_led(128);
green_led(128);
//while(1){
red_led(10);
//}
}
/
/*

int main()
{
while(1)
{
print(“POTATO!”); // display “Hello” at (0, 0), a.k.a. upper-left
delay_ms(200);
lcd_scroll(LCD_RIGHT, 3, 200);// shift the display right every 200ms three times
clear(); // clear the LCD
lcd_goto_xy(3, 1); // go to the fourth character of the second LCD line
print(“POTATO!”); // display “Hello” at (3, 1), a.k.a. lower-right
delay_ms(200);
lcd_scroll(LCD_LEFT, 3, 200); // shift the display left every 200ms three times
clear(); // clear the LCD
}

return 0;
}[/code]
We now can’t get it TO OUR ROBOT to run the code at all. All options that involve running the code and/or programming the chip are greyed out, including “Start without debugging,” which is the one I want. I have uploaded an attachment with a screenshot.


Hello.

I am sorry you are having trouble programming your 3pi. Which programmer are you using to program the 3pi? Have you ever been able to program this 3pi? What version of Windows and Atmel Studio are you running? Can you try going to the “Tools” menu, click “Device Programming”, and then use that interface to program your 3pi? If that is grayed out, can you upload a screenshot showing how it is grayed out?

-Jon

OK. I am using the pololu usbavr programmer. I have previously been able to program it. Atmel Studio 7.0 on Windows NT 6.1.7600 SP1 (this is almost always called Windows 7 home premium Service Pack 1)

I will try it.

Potato!