Britton Kerin wrote (in part):

... this ... prints garbage:
    PGM_P hello_string = "hello\n";
    printf_P (hello_string);

That's because it IS garbage. You have declared variable 'hello_string' as a pointer to program memory and then initialized it with the address of a string in data memory. What you need is this:

PGM_P hello_string = PSTR( "hello\n" );

Graham.



_______________________________________________
AVR-chat mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to