Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PeggyWriter example has erors #4

Open
GoogleCodeExporter opened this issue Aug 20, 2015 · 5 comments
Open

PeggyWriter example has erors #4

GoogleCodeExporter opened this issue Aug 20, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

The example 'PeggyWriter_Hello' has a few errors in it that prevent compiling 
as well as some kerning errors in the text display. A corrected version is 
below:



/* Simple example code for Peggy 2.0, using the Peggy2 and PeggyWriter libraries
*/

#include <Peggy2.h>
#include <stdlib.h> 
#include <PeggyWriter.h>

Peggy2 frame1;     // Make a frame buffer object, called frame1
PeggyWriter myWriter;  // Make a PeggyWriter object

void setup()                    // run once, when the sketch starts
{
     frame1.HardwareInit();   // Call this once to init the hardware
}  // End void setup()  


void loop()                     // run over and over again
{ 
  byte x = 2, y = 1;

  myWriter.drawCharacter('H',&frame1, x, y);
  x += 5;
  myWriter.drawCharacter('E',&frame1, x, y);
  x += 4;
  myWriter.drawCharacter('L',&frame1, x, y);
  x += 4;
  myWriter.drawCharacter('L',&frame1, x, y);
  x += 4;
  myWriter.drawCharacter('O',&frame1, x, y);
  x = 0;
  y += 7;
  myWriter.drawCharacter('W',&frame1, x, y);
  x += 6;
  myWriter.drawCharacter('O',&frame1, x, y);
  x += 5;
  myWriter.drawCharacter('R',&frame1, x, y);
  x += 5;
  myWriter.drawCharacter('L',&frame1, x, y);
  x += 4;
  myWriter.drawCharacter('D',&frame1, x, y);
  x += 5;

  while (1)
  {
    frame1.RefreshAll(1);
    delayMicroseconds(1000);
  }

}

Original issue reported on code.google.com by [email protected] on 28 Mar 2011 at 8:15

@GoogleCodeExporter
Copy link
Author

PeggyWriter is contributed software that is not officially supported or 
maintained.  You may wish to contact the author of that software directly-- I 
don't know if the author would notice this issue here.

If you have tested this fix and would like to add it to the project-- in the 
repository or as a download -- please let me know and I can add you as a 
committer on the project.

Original comment by [email protected] on 30 Mar 2011 at 5:58

@GoogleCodeExporter
Copy link
Author

It doesnt work for me still. Im not sure why I had it working a few days ago 
but not anymore. now i get this message ( im sorry its so long)











PeggyWriter_Hello.cpp: In function 'void loop()':
PeggyWriter_Hello:20: error: no matching function for call to 
'PeggyWriter::drawCharacter(char, Peggy2&, byte&, byte&)'
C:\Users\Mack\Documents\Arduino\arduino-0022\libraries\PeggyWriter_Hello/PeggyWr
iter.h:64: note: candidates are: void PeggyWriter::drawCharacter(char, Peggy2*, 
uint8_t, uint8_t)
PeggyWriter_Hello:22: error: no matching function for call to 
'PeggyWriter::drawCharacter(char, Peggy2&, byte&, byte&)'
C:\Users\Mack\Documents\Arduino\arduino-0022\libraries\PeggyWriter_Hello/PeggyWr
iter.h:64: note: candidates are: void PeggyWriter::drawCharacter(char, Peggy2*, 
uint8_t, uint8_t)
PeggyWriter_Hello:24: error: no matching function for call to 
'PeggyWriter::drawCharacter(char, Peggy2&, byte&, byte&)'
C:\Users\Mack\Documents\Arduino\arduino-0022\libraries\PeggyWriter_Hello/PeggyWr
iter.h:64: note: candidates are: void PeggyWriter::drawCharacter(char, Peggy2*, 
uint8_t, uint8_t)
PeggyWriter_Hello:26: error: no matching function for call to 
'PeggyWriter::drawCharacter(char, Peggy2&, byte&, byte&)'
C:\Users\Mack\Documents\Arduino\arduino-0022\libraries\PeggyWriter_Hello/PeggyWr
iter.h:64: note: candidates are: void PeggyWriter::drawCharacter(char, Peggy2*, 
uint8_t, uint8_t)
PeggyWriter_Hello:28: error: no matching function for call to 
'PeggyWriter::drawCharacter(char, Peggy2&, byte&, byte&)'
C:\Users\Mack\Documents\Arduino\arduino-0022\libraries\PeggyWriter_Hello/PeggyWr
iter.h:64: note: candidates are: void PeggyWriter::drawCharacter(char, Peggy2*, 
uint8_t, uint8_t)
PeggyWriter_Hello:31: error: no matching function for call to 
'PeggyWriter::drawCharacter(char, Peggy2&, byte&, byte&)'
C:\Users\Mack\Documents\Arduino\arduino-0022\libraries\PeggyWriter_Hello/PeggyWr
iter.h:64: note: candidates are: void PeggyWriter::drawCharacter(char, Peggy2*, 
uint8_t, uint8_t)
PeggyWriter_Hello:33: error: no matching function for call to 
'PeggyWriter::drawCharacter(char, Peggy2&, byte&, byte&)'
C:\Users\Mack\Documents\Arduino\arduino-0022\libraries\PeggyWriter_Hello/PeggyWr
iter.h:64: note: candidates are: void PeggyWriter::drawCharacter(char, Peggy2*, 
uint8_t, uint8_t)
PeggyWriter_Hello:35: error: no matching function for call to 
'PeggyWriter::drawCharacter(char, Peggy2&, byte&, byte&)'
C:\Users\Mack\Documents\Arduino\arduino-0022\libraries\PeggyWriter_Hello/PeggyWr
iter.h:64: note: candidates are: void PeggyWriter::drawCharacter(char, Peggy2*, 
uint8_t, uint8_t)
PeggyWriter_Hello:37: error: no matching function for call to 
'PeggyWriter::drawCharacter(char, Peggy2&, byte&, byte&)'
C:\Users\Mack\Documents\Arduino\arduino-0022\libraries\PeggyWriter_Hello/PeggyWr
iter.h:64: note: candidates are: void PeggyWriter::drawCharacter(char, Peggy2*, 
uint8_t, uint8_t)
PeggyWriter_Hello:39: error: no matching function for call to 
'PeggyWriter::drawCharacter(char, Peggy2&, byte&, byte&)'
C:\Users\Mack\Documents\Arduino\arduino-0022\libraries\PeggyWriter_Hello/PeggyWr
iter.h:64: note: candidates are: void PeggyWriter::drawCharacter(char, Peggy2*, 
uint8_t, uint8_t)

Original comment by [email protected] on 16 Jun 2011 at 11:47

@GoogleCodeExporter
Copy link
Author

Wrt Comment 2 by [email protected],

As it was working several days ago, your error is clearly unrelated to the 
Issue 4.  This report is misfiled and inappropriate. 

Original comment by [email protected] on 16 Jun 2011 at 11:58

@GoogleCodeExporter
Copy link
Author

Im sorry I had peggy scroller working and do now not peggy writer that your 
talking about right now.

Original comment by [email protected] on 17 Jun 2011 at 12:53

@GoogleCodeExporter
Copy link
Author

To make the PeggyWrite_Hello demo work change the x, y types to uint8_t and 
pass the address of frame1 instead of the direct instance itself.  

I'm not sure why it took over a year and a half for someone to post this simple 
code change fix and/or update the code. So much for open source and community :)

void loop()                     // run over and over again
{ 
  uint8_t x = 2, y = 1;

  myWriter.drawCharacter('H', &frame1, x, y);
  x += 4;
  myWriter.drawCharacter('E', &frame1, x, y);
  x += 4;
  myWriter.drawCharacter('L', &frame1, x, y);
  x += 4;
  myWriter.drawCharacter('L', &frame1, x, y);
  x += 5;
  myWriter.drawCharacter('O', &frame1, x, y);
  x = 0;
  y += 7;
  myWriter.drawCharacter('W', &frame1, x, y);
  x += 6;
  myWriter.drawCharacter('O', &frame1, x, y);
  x += 5;
  myWriter.drawCharacter('R', &frame1, x, y);
  x += 4;
  myWriter.drawCharacter('L', &frame1, x, y);
  x += 5;
  myWriter.drawCharacter('D', &frame1, x, y);
  x += 5;

  while (1)
  {
    frame1.RefreshAll(1);
    delayMicroseconds(1000);
  }

}

Original comment by [email protected] on 12 Mar 2013 at 11:44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant