Forum Index > Projects > LED Pegboard and Matrix Projects New Topic Post Reply
 Can anyone help me try my code and see what's wrong with it.
 |  Printable Version
by edisonguoyi (offline) on Monday, November 02 2009 @ 01:40 PM PST (Read 311 times)  
edisonguoyi

Recently, I am working on the Peggy2.0 projects.
And I wanna turn on all the LEDs, then I wrote the codes like this:

#define FPS 80


#include <Peggy2.h>

Peggy2 displayArea; // Make a first frame buffer object, called displayArea
//Peggy2 displayArea1;
//Peggy2 displayArea2;
//Peggy2 displayArea3;

void setup() // run once, when the sketch starts
{
displayArea.HardwareInit(); // Call this once to init the hardware.
// (Only needed once, even if you've got lots of frames.)
// Manually write sample pattern to buffer: turn on a few pixels, one by one:
} // End void setup()


byte i = 0;
byte j = 0;

void loop() // run over and over again
{
if(j>24)
{
j = 0;
i++;
if (i > 24)
{
displayArea.Clear();
i = 0;
j = 0;
}
}
else
{
displayArea.SetPoint(i,j);
delayMicroseconds(1000);
j++;
}

}

But it only turns on 6 coloums, then stop and begin it again.
I am wandering if the problem comes from hardware or not. But I can run the example program correctly.


Forum Apprentice
Apprentice

Status: offline

Registered: 10/30/09
Posts: 3

Profile Email    
  Quote
 
by Windell (offline) on Monday, November 02 2009 @ 02:58 PM PST  
Windell

If the built-in and example programs run correctly, then the hardware is probably working correctly.

Look at the example program peggy2_minimal for an example of what you're trying to do.

Looks like your code does not actually tell the Peggy to draw anything on the screen.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Admin
Admin

Status: offline

Registered: 06/15/06
Posts: 794

Profile Email Website  
  Quote
 
by edisonguoyi (offline) on Monday, November 02 2009 @ 03:50 PM PST  
edisonguoyi

Quote by: Windell

If the built-in and example programs run correctly, then the hardware is probably working correctly.

Look at the example program peggy2_minimal for an example of what you're trying to do.

Looks like your code does not actually tell the Peggy to draw anything on the screen.



It is supposed to turn on all the LEDs one by one by using function SetPoint(i,j) in the loop function.

Sometimes, if I touch the board, some random LEDs will be turned on and flash, and then disappear.
I am not sure that is normal or not.

Thanks a lot for answering my question.


Forum Apprentice
Apprentice

Status: offline

Registered: 10/30/09
Posts: 3

Profile Email    
  Quote
 
by Windell (offline) on Monday, November 02 2009 @ 04:27 PM PST  
Windell

>It is supposed to turn on all the LEDs one by one by using function SetPoint(i,j) in the loop function.

The SetPoint function writes to the buffer, it does not display to the screen. You need to use one of the refresh routines to do that. Again, please see the examples for a working model.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Admin
Admin

Status: offline

Registered: 06/15/06
Posts: 794

Profile Email Website  
  Quote
 
by edisonguoyi (offline) on Monday, November 02 2009 @ 11:37 PM PST  
edisonguoyi

I tried the example "minimal". That doesn't work.


Forum Apprentice
Apprentice

Status: offline

Registered: 10/30/09
Posts: 3

Profile Email    
  Quote
 
by Windell (offline) on Monday, November 02 2009 @ 11:57 PM PST  
Windell

>I tried the example "minimal". That doesn't work.

Okay... You said earlier that you can "run the example program correctly." Which example program are you referring to?


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Admin
Admin

Status: offline

Registered: 06/15/06
Posts: 794

Profile Email Website  
  Quote
 
Content generated in: 0.83 seconds
New Topic Post Reply



 All times are PST. The time is now 06:08 PM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
HTML Allowed 
Censored Content 

Welcome to Evil Mad Scientist Laboratories. New projects are posted every Wednesday.


Bookmark EMSL

EMSL RSS Feed
Twitter: EMSL
del.icio.us
feedburner
Feed on Google Reader
YouTube Channel
Add technorati Fave

technorati search

Subscribe to get new articles by E-mail:

E-mail address:


Preview | Powered by FeedBlitz

My Account





Sign up as a New User
Lost your password?

Who's Online

Guest Users: 6

Forumposts

Order: New Views Posts
Latest 5 Forum Posts
 
Re: Ferritc core sub..
 By:  npkeith
 On:  Friday, November 20 2009 @ 10:34 AM PST
 Views 0 Replies 0
Re: alphanumeric led..
 By:  karlgg
 On:  Thursday, November 19 2009 @ 10:14 PM PST
 Views 0 Replies 0
Re: alphanumeric led..
 By:  Leviathan34
 On:  Thursday, November 19 2009 @ 07:21 PM PST
 Views 0 Replies 0
Re: 0 of 9 LEDs work..
 By:  Windell
 On:  Thursday, November 19 2009 @ 12:52 PM PST
 Views 0 Replies 0
Re: 0 of 9 LEDs work..
 By:  michael pechner
 On:  Thursday, November 19 2009 @ 11:40 AM PST
 Views 0 Replies 0

DIY Hardware for Electronic Art


Interactive LED Panels


Meggy Jr RGB
LED matrix game
development kit.


Business-card sized
AVR target boards


Peggy 2
LED Pegboard kits