Maintenance notice: These forum archives are read-only, and will be removed shortly. Please visit our forums at their new location, https://www.evilmadscientist.com/forums/.

PeggyDraw 2 Error

This discussion was created from comments split from: Peggy 2 novice having problems with Peggy Draw 2.

Comments

  • edited July 2013
    Ok... I just tried to upload the sketch I made in Processing to the arduino to the board - 

    I have to note that we had to modify the board to use an UNO chip because the ATmega that came with it seemed to have gotten corrupted :/ - The Uno was programing the examples from the Peggy 2 library with no problem. 

    Here is what I get when I try to verfiy/upload the sketch I just finished in processing. Again any help would be awesome. Thanks!
  • The error indicates that you do not have the Peggy 2 library for Arduino installed, so it's more of a failure-to-install-software fail, rather than a Peggy fail.  Please download and install that library and restart Arduino before trying again.
  • edited July 2013
    Hhmmm... I thought I did that... you just download the Peggy2 folder and put it in the libraries subfolder of arudino correct? and yeah... the peggy hardware works fine... its a programming issue (I'm a lot better with tactile things, just learning to program recently) 

    Here's a http://www.flickr.com/photos/90777409@N02/9304471116/

    Maybe I have the Peggydraw_heartart in a wrong relationship to it? - thanks for your help and your answer on the animation possibilities. 
  • Yes, that installation looks correct; try restarting Arduino to see if it is installed correctly.

    (And, after years of helping people to debug issues like this, your description, with that one picture of where it goes is *by far* the clearest illustration that I've ever seen-- thank you!)

    If the library is installed correctly, you should see Peggy2 listed in your File>Examples menu within Arduino. 
  • Yes, the Peggy2 File>Examples menu works fine and programs in (loads to the board) just fine. I spent some time this morning going through and loading all of them and doing simple mods to get a feel for the code and it uses. 

    The Peggydraw however and the Peggydraw_heartart both still are showing the same errors :( - I want to try to get my own content on here with it... which... will happen eventually!

    Also yeah, appreciate the compliment I used to teach graphics programs (Adobe Suite) at a major art school so tried to got my ninja screenshot skills down ;) - I had a bout with cancer and my head isn't always all there but I'm going to start teaching again in the fall so glad its coming back :) 
  • Oh-- I see --I have made a mistake here, and I do apologize.  

    I had mistaken the source of the "does not name a type" error, which almost always indicates that one of the Arduino libraries is not installed. However, that's not what's going on here.  What's actually going on is that you've opened up the Processing application itself (PeggyDraw 2)-- not the output file that it created.  When you save a file in PeggyDraw 2, it shows up in the data/PeggyProgram folder-- and *that* is the output that you should open with Arduino. 





  • Ok.... Closer but still no... :/ now a whole different error... but it seems like its almost there...

    so it is setup lke... http://www.flickr.com/photos/90777409@N02/9302093837/

    I get it to run the program and save it, it looks like 
    http://www.flickr.com/photos/90777409@N02/9304957540/
    Which seems a lot more like what it should be... and is awesome

    but when I open PeggyProgram.pde with arduino and try to run it I get

     - http://www.flickr.com/photos/90777409@N02/9302178233/in/photostream/


  • Can you please paste the contents of the Peggy program?
  • Sorry... have to split the post it says its too long.... Pt 1:

    /* Simple example code for Peggy 2.0, using the Peggy2 library, version 0.2.
     
     Designed to be automatically generated!
     
     Copyright (c) 2008 Windell H Oskay.  All right reserved.
     
     This example is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     License as published by the Free Software Foundation; either
     version 2.1 of the License, or (at your option) any later version.
     
     This software is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     Lesser General Public License for more details.
     
     You should have received a copy of the GNU Lesser General Public
     License along with this software; if not, write to the Free Software
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     */

    #include <Peggy2.h>
    #include <math.h>
    #include <stdlib.h> 
    #include <avr/pgmspace.h> 

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


    const PROGMEM prog_uint32_t data1[]  = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    250,
    1104,
    1106,
    1106,
    1118,
    1490,
    82,
    1106,
    17618,
    16383,
    532992,
    0,
    64,
    0,
    4096,
    0,
    128

  • 0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    250,
    1104,
    1106,
    1106,
    1118,
    1490,
    82,
    1106,
    17618,
    16383,
    532992,
    0,
    64,
    0,
    4096,
    0,
    128
    0,
    0,
    1536,
    0,
    0,
    0,
    0,
    0,
    250,
    1104,
    1106,
    1106,
    1118,
    1490,
    82,
    1106,
    17618,
    16383,
    532992,
    0,
    64,
    0,
    4096,
    0,
    128
    0,
    0,
    1536,
    0,
    0,
    0,
    0,
    0,
    250,
    1104,
    1106,
    1106,
    1118,
    1490,
    82,
    1106,
    17618,
    16383,
    532992,
    0,
    64,
    0,
    4096,
    0,
    128
    };
     


    void setup()                    // run once, when the sketch starts
    {
      frame1.HardwareInit();   // Call this once to init the hardware. 
      // (Only needed once, even if you've got lots of frames.)

      unsigned short y = 0;     
      
      while (y < 25) {


        frame1.WriteRow( y, pgm_read_dword(&data1[y]));  

        y++;

      }




    }  // End void setup()  


    void loop()                     // run over and over again

      frame1.RefreshAll(10); //Draw frame buffer 10 times 

    }
  • Okay, this file doesn't actually look like the one that PeggyDraw 2 generates for me-- is it possible that you're using the old, deprecated version of PeggyDraw 2?   I'd suggest that you download a fresh copy:  http://code.google.com/p/peggy/downloads/detail?name=PeggyDraw2, v1.1.zip
  • DUDE!!!!!!!!!!!!  Check this out!!! 

    :D 

    http://www.flickr.com/photos/90777409@N02/9303441909/

    its my 3 year stem cell transplantaversary as of 55 minutes ago... this is a tremendously awesome way to start it :D

    Thanks again Evil Genius you! Fresh v1.1 for fresh code! Word! 
  • Okay-- great!  And, again, my apology for not catching that initial error correctly the first time. 

    -Windell
  • No worries man! Thanks for all your help! 

    One more question, I'd really love to do more with programming in variable shades, I know you briefly touched on that in the other thread you split my questions into, do you have any suggestions for places/resources to study up on doing that?

    This will def get me through the event this weekend but we're going to be using this in our kids programming classes too I think and want to try to get more versed in how the actual code works. We have one or two arduino masters at our maker space, but they're not always around... 

    S
  • edited July 2013
    The Peggy 2 hardware-- natively --only knows about on and off. However, the refresh rate is very high, so we can simulate multiple brightness levels by trading off refresh rate, and lighting some of the LEDs for only part of the time-- quite convincingly to the eye. We show off this capability in a few of the demo programs, and also use it in the "Peggy 2 video" examples, where we let the Peggy 2 receive serial-streamed data with 16 levels of brightness. You might want to look at those examples as a starting point. 


    For PeggyDraw 2, we wanted to make it simple to use and able to draw a lot of frames (~250), so it's single-level on/off. If we rewrote it to use 16 grayscale levels, that would requires four times as much memory (4 bits per LED), so only 1/4 as many frames could be stored in memory, or about 60 frames maximum. Perhaps 8 gray levels (3 bits per LED) would be a better choice, giving about 120 frames available.
Sign In or Register to comment.