Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  17 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Roger Lo  
View profile  
 More options Aug 24 2012, 3:47 pm
From: Roger Lo <rogerloh...@gmail.com>
Date: Fri, 24 Aug 2012 12:47:46 -0700 (PDT)
Local: Fri, Aug 24 2012 3:47 pm
Subject: I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

I wrote an animation that's similar to those green words from the Matrix
trilogy movie. I want to repeat a part of the animation as long as the
Arduino is powered, but it kept stopped at some point, at one frame after
repeating multiple times already. The frame requires the LED matrix to scan
through the matrix, so I don't think Arduino stop working. Does anyone know
what's going on?

the code is from below, if you think you need to check it. It's pretty long
though, got like 40 maps.

byte dot1[] = {
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000};

byte dot2[] = {
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B10000010};

byte dot3[] = {
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B10000010,
B00001000};

byte dot4[] = {
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000010,
B10001000,
B01010001};

byte dot5[] = {
B00000000,
B00000000,
B00000000,
B00000000,
B10000010,
B00001000,
B01010001,
B00000100};

byte dot6[] = {
B00000000,
B00000000,
B00000000,
B10000010,
B00001000,
B01010001,
B00000100,
B00101000};

byte dot7[] = {
B00000000,
B00000000,
B10000010,
B00001000,
B01010001,
B00000100,
B00101000,
B10000110};

byte dot8[] = {
B00000000,
B10000010,
B00001000,
B01010001,
B00000100,
B00101000,
B10000110,
B00010000};

byte dot9[] = {
B10000010,
B00001000,
B01010001,
B00000100,
B00101000,
B10000110,
B00010000,
B00100001};

byte dot10[] = {
B00001000,
B01010001,
B00000100,
B00101000,
B10000110,
B00010000,
B00100001,
B01000000};

byte dot11[] = {
B01010001,
B00000100,
B00101000,
B10000110,
B00010000,
B00100001,
B01000000,
B00000000};

byte dot12[] = {
B00000100,
B00101000,
B10000110,
B00010000,
B00100001,
B01000000,
B00000000,
B00000000};

byte dot13[] = {
B00101000,
B10000110,
B00010000,
B00100001,
B01000000,
B00000000,
B00000000,
B10000010};

byte dot14[] = {
B10000110,
B00010000,
B00100001,
B01000000,
B00000000,
B00000000,
B10000010,
B00001000};

byte dot15[] = {
B00010000,
B00100001,
B01000000,
B00000000,
B00000000,
B10000010,
B00001000,
B01010001};

byte dot16[] = {
B00100001,
B01000000,
B00000000,
B00000000,
B10000010,
B00001000,
B01010001,
B00000100};

byte dot17[] = {
B01000000,
B00000000,
B00000000,
B10000010,
B00001000,
B01010001,
B00000100,
B00101000};

byte dot18[] = {
B00000000,
B00000000,
B10000010,
B00001000,
B01010001,
B00000100,
B00101000,
B10000110};

byte dot19[] = {
B00000000,
B10000010,
B00001000,
B01010001,
B00000100,
B00101000,
B10000110,
B00010000};

byte dot20[] = {
B10000010,
B00001000,
B01010001,
B00000100,
B00101000,
B10000110,
B00010000,
B00100001};

byte tail1[] = {
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000};

byte tail2[] = {
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000};

byte tail3[] = {
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B10000010};

byte tail4[] = {
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B10000010,
B10001010};

byte tail5[] = {
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B10000010,
B10001010,
B11011011};

byte tail6[] = {
B00000000,
B00000000,
B00000000,
B00000000,
B10000010,
B10001010,
B11011011,
B01010101};

byte tail7[] = {
B00000000,
B00000000,
B00000000,
B10000010,
B10001010,
B11011011,
B01010101,
B01111001};

byte tail8[] = {
B00000000,
B00000000,
B10000010,
B10001010,
B11011011,
B01010101,
B01111001,
B10101110};

byte tail9[] = {
B00000000,
B10000010,
B10001010,
B11011011,
B01010101,
B01111001,
B10101110,
B10011110};

byte tail10[] = {
B10000010,
B10001010,
B11011011,
B01010101,
B01111001,
B10101110,
B10011110,
B10110111};

byte tail11[] = {
B10001010,
B11011011,
B01010101,
B01111001,
B10101110,
B10011110,
B10110111,
B01110001};

byte tail12[] = {
B11011011,
B01010101,
B01111001,
B10101110,
B10011110,
B10110111,
B01110001,
B01100001};

byte tail13[] = {
B01010101,
B01111001,
B10101110,
B10011110,
B10110111,
B01110001,
B01100001,
B01000000};

byte tail14[] = {
B01111001,
B10101110,
B10011110,
B10110111,
B01110001,
B01100001,
B01000000,
B10000010};

byte tail15[] = {
B10101110,
B10011110,
B10110111,
B01110001,
B01100001,
B01000000,
B10000010,
B10001010};

byte tail16[] = {
B10011110,
B10110111,
B01110001,
B01100001,
B01000000,
B10000010,
B10001010,
B11011011};

byte tail17[] = {
B10110111,
B01110001,
B01100001,
B01000000,
B10000010,
B10001010,
B11011011,
B01010101};

byte tail18[] = {
B01110001,
B01100001,
B01000000,
B10000010,
B10001010,
B11011011,
B01010101,
B01111001};

byte tail19[] = {
B01100001,
B01000000,
B10000010,
B10001010,
B11011011,
B01010101,
B01111001,
B10101110};

byte tail20[] = {
B01000000,
B10000010,
B10001010,
B11011011,
B01010101,
B01111001,
B10101110,
B10011110};

const int columnPins[] = { 2, 3, 4, 5, 6, 7, 8, 9};
const int rowPins[] = { 10,11,12,15,16,17,18,19};
const int frameDuration = 100;
void setup() {
for (int i = 0; i < 8; i++)
{
pinMode(rowPins[i], OUTPUT);
pinMode(columnPins[i], OUTPUT);
digitalWrite(columnPins[i], HIGH);

}
}

void loop() {
int pulseDelay = 1 ;

int frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot1, 20);
show(tail1, 8);

}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot2, 20);
show(tail2, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot3, 20);
show(tail3, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot4, 20);
show(tail4, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot5, 20);
show(tail5, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot6, 20);
show(tail6, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot7, 20);
show(tail7, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot8, 20);
show(tail8, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot9, 20);
show(tail9, 8);
}

while(int drone = 1){
frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot10, 20);
show(tail10, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot11, 20);
show(tail11, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot12, 20);
show(tail12, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot13, 20);
show(tail13, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot14, 20);
show(tail14, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot15, 20);
show(tail15, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot16, 20);
show(tail16, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot17, 20);
show(tail17, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot18, 20);
show(tail18, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot19, 20);
show(tail19, 8);
}

frameStart = millis();
while(frameStart + frameDuration > millis())
{
show(dot20, 20);
show(tail20, 8);
}
}
}

void show( byte * image, unsigned long duration)
{
unsigned long start = millis();
while (start + duration > millis())
{
for(int row = 0; row < 8; row++)
{
digitalWrite(rowPins[row], HIGH);
for(int column = 0; column < 8; column++)
{
boolean pixel = bitRead(image[row],column);
if(pixel == 1)
{
digitalWrite(columnPins[column], LOW);
delayMicroseconds(duration);
}

else if(pixel == 2)
{
digitalWrite(columnPins[column], LOW);
delayMicroseconds(duration);

}

digitalWrite(columnPins[column], HIGH);
}

digitalWrite(rowPins[row], LOW);


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hamilton Elliott  
View profile  
 More options Aug 25 2012, 5:06 am
From: "Hamilton Elliott" <helli...@microflex.ie>
Date: Sat, 25 Aug 2012 10:06:02 +0100
Local: Sat, Aug 25 2012 5:06 am
Subject: RE: [tronixstuff: 2156] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Hi Roger,

If I was doing what you want, I would create a two dimensional array to put
the data in, and then use nested loops to process the array.

Secondly, you need to be able to debug what is actually happening, so put in
Serial.println("info.."); with the info showing where you are in the program
and also print variables to show what values you have got. Otherwise you are
going to have to "run the program" on paper writing down what all the
variables are as you work your way through the code. This can work, but is
very slow and it is easy to write down what you think should be happening
instead of what actually happens. I think that the best way with an Arduino
without a proper debugger is to use Serial.print(...) statements.

Regards,

Hamilton

From: tronixstuff@googlegroups.com [mailto:tronixstuff@googlegroups.com] On
Behalf Of Roger Lo
Sent: 24 August 2012 20:48
To: tronixstuff@googlegroups.com
Subject: [tronixstuff: 2156] I used my Arduino to perform an animation on an
8x8 LED matrix, and the animation stopped at some point but I told it to
goes on forever.

I wrote an animation that's similar to those green words from the Matrix
trilogy movie. I want to repeat a part of the animation as long as the
Arduino is powered, but it kept stopped at some point, at one frame after
repeating multiple times already. The frame requires the LED matrix to scan
through the matrix, so I don't think Arduino stop working. Does anyone know
what's going on?

the code is from below, if you think you need to check it. It's pretty long
though, got like 40 maps.

byte dot1[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000};

byte dot2[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B10000010};

byte dot3[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B10000010,

B00001000};

byte dot4[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000010,

B10001000,

B01010001};

byte dot5[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B10000010,

B00001000,

B01010001,

B00000100};

byte dot6[] = {

B00000000,

B00000000,

B00000000,

B10000010,

B00001000,

B01010001,

B00000100,

B00101000};

byte dot7[] = {

B00000000,

B00000000,

B10000010,

B00001000,

B01010001,

B00000100,

B00101000,

B10000110};

byte dot8[] = {

B00000000,

B10000010,

B00001000,

B01010001,

B00000100,

B00101000,

B10000110,

B00010000};

byte dot9[] = {

B10000010,

B00001000,

B01010001,

B00000100,

B00101000,

B10000110,

B00010000,

B00100001};

byte dot10[] = {

B00001000,

B01010001,

B00000100,

B00101000,

B10000110,

B00010000,

B00100001,

B01000000};

byte dot11[] = {

B01010001,

B00000100,

B00101000,

B10000110,

B00010000,

B00100001,

B01000000,

B00000000};

byte dot12[] = {

B00000100,

B00101000,

B10000110,

B00010000,

B00100001,

B01000000,

B00000000,

B00000000};

byte dot13[] = {

B00101000,

B10000110,

B00010000,

B00100001,

B01000000,

B00000000,

B00000000,

B10000010};

byte dot14[] = {

B10000110,

B00010000,

B00100001,

B01000000,

B00000000,

B00000000,

B10000010,

B00001000};

byte dot15[] = {

B00010000,

B00100001,

B01000000,

B00000000,

B00000000,

B10000010,

B00001000,

B01010001};

byte dot16[] = {

B00100001,

B01000000,

B00000000,

B00000000,

B10000010,

B00001000,

B01010001,

B00000100};

byte dot17[] = {

B01000000,

B00000000,

B00000000,

B10000010,

B00001000,

B01010001,

B00000100,

B00101000};

byte dot18[] = {

B00000000,

B00000000,

B10000010,

B00001000,

B01010001,

B00000100,

B00101000,

B10000110};

byte dot19[] = {

B00000000,

B10000010,

B00001000,

B01010001,

B00000100,

B00101000,

B10000110,

B00010000};

byte dot20[] = {

B10000010,

B00001000,

B01010001,

B00000100,

B00101000,

B10000110,

B00010000,

B00100001};

byte tail1[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000};

byte tail2[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000};

byte tail3[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B10000010};

byte tail4[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B10000010,

B10001010};

byte tail5[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B10000010,

B10001010,

B11011011};

byte tail6[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B10000010,

B10001010,

B11011011,

B01010101};

byte tail7[] = {

B00000000,

B00000000,

B00000000,

B10000010,

B10001010,

B11011011,

B01010101,

B01111001};

byte tail8[] = {

B00000000,

B00000000,

B10000010,

B10001010,

B11011011,

B01010101,

B01111001,

B10101110};

byte tail9[] = {

B00000000,

B10000010,

B10001010,

B11011011,

B01010101,

B01111001,

B10101110,

B10011110};

byte tail10[] = {

B10000010,

B10001010,

B11011011,

B01010101,

B01111001,

B10101110,

B10011110,

B10110111};

byte tail11[] = {

B10001010,

B11011011,

B01010101,

B01111001,

B10101110,

B10011110,

B10110111,

B01110001};

byte tail12[] = {

B11011011,

B01010101,

B01111001,

B10101110,

B10011110,

B10110111,

B01110001,

B01100001};

byte tail13[] = {

B01010101,

B01111001,

B10101110,

B10011110,

B10110111,

B01110001,

B01100001,

B01000000};

byte tail14[] = {

B01111001,

B10101110,

B10011110,

B10110111,

B01110001,

B01100001,

B01000000,

B10000010};

byte tail15[] = {

B10101110,

B10011110,

B10110111,

B01110001,

B01100001,

B01000000,

B10000010,

B10001010};

byte tail16[] = {

B10011110,

B10110111,

B01110001,

B01100001,

B01000000,

B10000010,

B10001010,

B11011011};

byte tail17[] = {

B10110111,

B01110001,

B01100001,

B01000000,

B10000010,

B10001010,

B11011011,

B01010101};

byte tail18[] = {

B01110001,

B01100001,

B01000000,

B10000010,

B10001010,

B11011011,

B01010101,

B01111001};

byte tail19[] = {

B01100001,

B01000000,

B10000010,

B10001010,

B11011011,

B01010101,

B01111001,

B10101110};

byte tail20[] = {

B01000000,

B10000010,

B10001010,

B11011011,

B01010101,

B01111001,

B10101110,

B10011110};

const int columnPins[] = { 2, 3, 4, 5, 6, 7, 8, 9};

const int rowPins[] = { 10,11,12,15,16,17,18,19};

const int frameDuration = 100;

void setup() {

for (int i = 0; i < 8; i++)

{

pinMode(rowPins[i], OUTPUT);

pinMode(columnPins[i], OUTPUT);

digitalWrite(columnPins[i], HIGH);

}
}

void loop() {

int pulseDelay = 1 ;

int frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot1, 20);

show(tail1, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot2, 20);

show(tail2, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot3, 20);

show(tail3, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot4, 20);

show(tail4, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot5, 20);

show(tail5, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot6, 20);

show(tail6, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot7, 20);

show(tail7, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot8, 20);

show(tail8, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot9, 20);

show(tail9, 8);

}

while(int drone = 1){

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot10, 20);

show(tail10, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot11, 20);

show(tail11, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot12, 20);

show(tail12, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot13, 20);

show(tail13, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot14, 20);

show(tail14, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot15, 20);

show(tail15, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot16, 20);

show(tail16, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot17, 20);

show(tail17, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot18, 20);

show(tail18, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot19, 20);

show(tail19, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot20, 20);
...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
craig  
View profile  
 More options Aug 25 2012, 7:10 am
From: craig <cr...@millspringfarm.com.au>
Date: Sat, 25 Aug 2012 04:10:22 -0700 (PDT)
Local: Sat, Aug 25 2012 7:10 am
Subject: Re: I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

hi
whats this line for ?    while(int drone = 1){        ?

craig


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger Lo  
View profile  
 More options Aug 25 2012, 8:19 am
From: Roger Lo <rogerloh...@gmail.com>
Date: Sat, 25 Aug 2012 20:19:00 +0800
Subject: Re: [tronixstuff: 2159] Re: I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

I just try to let it be true all the time. I tried wit just while(1) as
well, but still, the animation stopped at one point.

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger Lo  
View profile  
 More options Aug 25 2012, 10:40 am
From: Roger Lo <rogerloh...@gmail.com>
Date: Sat, 25 Aug 2012 22:40:39 +0800
Local: Sat, Aug 25 2012 10:40 am
Subject: Re: [tronixstuff: 2157] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Hi Hamilton,
Do you mean you right a array, and let the function scan different part of
the array?

Just like that? Serial.printIn("info....")? or that info... is suppose to
be something else? Sorry, I only just got my first Arduino board this
summer, I'm still learning how to use it.

On Sat, Aug 25, 2012 at 5:06 PM, Hamilton Elliott <helli...@microflex.ie>wrote:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hamilton Elliott  
View profile   Translate to Translated (View Original)
 More options Aug 25 2012, 11:54 am
From: "Hamilton Elliott" <helli...@microflex.ie>
Date: Sat, 25 Aug 2012 16:54:44 +0100
Local: Sat, Aug 25 2012 11:54 am
Subject: RE: [tronixstuff: 2161] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Hi Roger,

Instead of telling you what was wrong in the program I was trying to show
you how to find the bugs yourself. I didn't look at your code in detail so I
didn't see the error. I also wasn't sure of your level of programming
skills.

In the array you want 20 items each 8 bytes long so define it as:

Byte dots[20][8] = { .. }; // substitute your values for the ..

I have attached my code in a file. I think that attachments are allowed.
This will test that!

Always try to think of loops that you can use to reduce the code that you
have to type and it also makes the program smaller.

Adopt a style of indents and stick to it. I use a tab (4 spaces) when I have
a loop. You can see what I mean in my code.

The Serial.print() function shows in the serial monitor window. Don't forget
the Serial.begin(9600); to start it up!

In my previous example Serial.println("info.."); the info is something that
means something to you about what is happening in the program.

I usually us something like Serial.print("Now doing the loop ");
Serial.println(loopcounter); and I would get an output like this:

Now doing the loop 0

Now doing the loop 1

Now doing the loop 2

etc.

When I have a piece of code working I don't remove the print statements, I
just comment them. For a large program I use #define and #ifdef so that I
can turn on a lot of print statements for a section of the program. Ask if
you want me to explain more.

Regards,

Hamilton

From: tronixstuff@googlegroups.com [mailto:tronixstuff@googlegroups.com] On
Behalf Of Roger Lo
Sent: 25 August 2012 15:41
To: tronixstuff@googlegroups.com
Subject: Re: [tronixstuff: 2161] I used my Arduino to perform an animation
on an 8x8 LED matrix, and the animation stopped at some point but I told it
to goes on forever.

Hi Hamilton,
Do you mean you right a array, and let the function scan different part of
the array?

Just like that? Serial.printIn("info....")? or that info... is suppose to be
something else? Sorry, I only just got my first Arduino board this summer,
I'm still learning how to use it.

On Sat, Aug 25, 2012 at 5:06 PM, Hamilton Elliott <helli...@microflex.ie>
wrote:

Hi Roger,

If I was doing what you want, I would create a two dimensional array to put
the data in, and then use nested loops to process the array.

Secondly, you need to be able to debug what is actually happening, so put in
Serial.println("info.."); with the info showing where you are in the program
and also print variables to show what values you have got. Otherwise you are
going to have to "run the program" on paper writing down what all the
variables are as you work your way through the code. This can work, but is
very slow and it is easy to write down what you think should be happening
instead of what actually happens. I think that the best way with an Arduino
without a proper debugger is to use Serial.print(...) statements.

Regards,

Hamilton

From: tronixstuff@googlegroups.com [mailto:tronixstuff@googlegroups.com] On
Behalf Of Roger Lo
Sent: 24 August 2012 20:48
To: tronixstuff@googlegroups.com
Subject: [tronixstuff: 2156] I used my Arduino to perform an animation on an
8x8 LED matrix, and the animation stopped at some point but I told it to
goes on forever.

I wrote an animation that's similar to those green words from the Matrix
trilogy movie. I want to repeat a part of the animation as long as the
Arduino is powered, but it kept stopped at some point, at one frame after
repeating multiple times already. The frame requires the LED matrix to scan
through the matrix, so I don't think Arduino stop working. Does anyone know
what's going on?

the code is from below, if you think you need to check it. It's pretty long
though, got like 40 maps.

byte dot1[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000};

byte dot2[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B10000010};

byte dot3[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B10000010,

B00001000};

byte dot4[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000010,

B10001000,

B01010001};

byte dot5[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B10000010,

B00001000,

B01010001,

B00000100};

byte dot6[] = {

B00000000,

B00000000,

B00000000,

B10000010,

B00001000,

B01010001,

B00000100,

B00101000};

byte dot7[] = {

B00000000,

B00000000,

B10000010,

B00001000,

B01010001,

B00000100,

B00101000,

B10000110};

byte dot8[] = {

B00000000,

B10000010,

B00001000,

B01010001,

B00000100,

B00101000,

B10000110,

B00010000};

byte dot9[] = {

B10000010,

B00001000,

B01010001,

B00000100,

B00101000,

B10000110,

B00010000,

B00100001};

byte dot10[] = {

B00001000,

B01010001,

B00000100,

B00101000,

B10000110,

B00010000,

B00100001,

B01000000};

byte dot11[] = {

B01010001,

B00000100,

B00101000,

B10000110,

B00010000,

B00100001,

B01000000,

B00000000};

byte dot12[] = {

B00000100,

B00101000,

B10000110,

B00010000,

B00100001,

B01000000,

B00000000,

B00000000};

byte dot13[] = {

B00101000,

B10000110,

B00010000,

B00100001,

B01000000,

B00000000,

B00000000,

B10000010};

byte dot14[] = {

B10000110,

B00010000,

B00100001,

B01000000,

B00000000,

B00000000,

B10000010,

B00001000};

byte dot15[] = {

B00010000,

B00100001,

B01000000,

B00000000,

B00000000,

B10000010,

B00001000,

B01010001};

byte dot16[] = {

B00100001,

B01000000,

B00000000,

B00000000,

B10000010,

B00001000,

B01010001,

B00000100};

byte dot17[] = {

B01000000,

B00000000,

B00000000,

B10000010,

B00001000,

B01010001,

B00000100,

B00101000};

byte dot18[] = {

B00000000,

B00000000,

B10000010,

B00001000,

B01010001,

B00000100,

B00101000,

B10000110};

byte dot19[] = {

B00000000,

B10000010,

B00001000,

B01010001,

B00000100,

B00101000,

B10000110,

B00010000};

byte dot20[] = {

B10000010,

B00001000,

B01010001,

B00000100,

B00101000,

B10000110,

B00010000,

B00100001};

byte tail1[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000};

byte tail2[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000};

byte tail3[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B10000010};

byte tail4[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B10000010,

B10001010};

byte tail5[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B00000000,

B10000010,

B10001010,

B11011011};

byte tail6[] = {

B00000000,

B00000000,

B00000000,

B00000000,

B10000010,

B10001010,

B11011011,

B01010101};

byte tail7[] = {

B00000000,

B00000000,

B00000000,

B10000010,

B10001010,

B11011011,

B01010101,

B01111001};

byte tail8[] = {

B00000000,

B00000000,

B10000010,

B10001010,

B11011011,

B01010101,

B01111001,

B10101110};

byte tail9[] = {

B00000000,

B10000010,

B10001010,

B11011011,

B01010101,

B01111001,

B10101110,

B10011110};

byte tail10[] = {

B10000010,

B10001010,

B11011011,

B01010101,

B01111001,

B10101110,

B10011110,

B10110111};

byte tail11[] = {

B10001010,

B11011011,

B01010101,

B01111001,

B10101110,

B10011110,

B10110111,

B01110001};

byte tail12[] = {

B11011011,

B01010101,

B01111001,

B10101110,

B10011110,

B10110111,

B01110001,

B01100001};

byte tail13[] = {

B01010101,

B01111001,

B10101110,

B10011110,

B10110111,

B01110001,

B01100001,

B01000000};

byte tail14[] = {

B01111001,

B10101110,

B10011110,

B10110111,

B01110001,

B01100001,

B01000000,

B10000010};

byte tail15[] = {

B10101110,

B10011110,

B10110111,

B01110001,

B01100001,

B01000000,

B10000010,

B10001010};

byte tail16[] = {

B10011110,

B10110111,

B01110001,

B01100001,

B01000000,

B10000010,

B10001010,

B11011011};

byte tail17[] = {

B10110111,

B01110001,

B01100001,

B01000000,

B10000010,

B10001010,

B11011011,

B01010101};

byte tail18[] = {

B01110001,

B01100001,

B01000000,

B10000010,

B10001010,

B11011011,

B01010101,

B01111001};

byte tail19[] = {

B01100001,

B01000000,

B10000010,

B10001010,

B11011011,

B01010101,

B01111001,

B10101110};

byte tail20[] = {

B01000000,

B10000010,

B10001010,

B11011011,

B01010101,

B01111001,

B10101110,

B10011110};

const int columnPins[] = { 2, 3, 4, 5, 6, 7, 8, 9};

const int rowPins[] = { 10,11,12,15,16,17,18,19};

const int frameDuration = 100;

void setup() {

for (int i = 0; i < 8; i++)

{

pinMode(rowPins[i], OUTPUT);

pinMode(columnPins[i], OUTPUT);

digitalWrite(columnPins[i], HIGH);

}
}

void loop() {

int pulseDelay = 1 ;

int frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot1, 20);

show(tail1, 8);

}

frameStart = millis();

while(frameStart + frameDuration > millis())

{

show(dot2, 20); ...

read more »

  quicktest5.pde
2K Download

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 120825-0, 25/08/2012
Tested on: 8/25/2012 16:54:48
avast! - copyright (c) 1988-2012 AVAST Software.
http://www.avast.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger Lo  
View profile  
 More options Aug 25 2012, 12:09 pm
From: Roger Lo <rogerloh...@gmail.com>
Date: Sun, 26 Aug 2012 00:09:21 +0800
Local: Sat, Aug 25 2012 12:09 pm
Subject: Re: [tronixstuff: 2162] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Oh, I understand the checking part. But I can't understand the array. Did
you turn a row in my sketch into a hex number?

On Sat, Aug 25, 2012 at 11:54 PM, Hamilton Elliott <helli...@microflex.ie>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hamilton Elliott  
View profile  
 More options Aug 25 2012, 1:02 pm
From: "Hamilton Elliott" <helli...@microflex.ie>
Date: Sat, 25 Aug 2012 18:02:38 +0100
Local: Sat, Aug 25 2012 1:02 pm
Subject: RE: [tronixstuff: 2163] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Roger,

I would use hex because its shorter, each 8 bits can be referenced as
binary, hex or you could also use a character or a decimal number but hex or
binary makes sense in this context. It doesn't matter what way you specify
the values of the 8 bits. B01100011 = 0x63 = 'c' = 99.

Do you understand how to process the array(s) in one loop embedded in the
other?

Regards,

Hamilton

From: tronixstuff@googlegroups.com [mailto:tronixstuff@googlegroups.com] On
Behalf Of Roger Lo
Sent: 25 August 2012 17:09
To: tronixstuff@googlegroups.com
Subject: Re: [tronixstuff: 2163] I used my Arduino to perform an animation
on an 8x8 LED matrix, and the animation stopped at some point but I told it
to goes on forever.

Oh, I understand the checking part. But I can't understand the array. Did
you turn a row in my sketch into a hex number?

On Sat, Aug 25, 2012 at 11:54 PM, Hamilton Elliott <helli...@microflex.ie>
wrote:

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 120825-0, 25/08/2012
Tested on: 8/25/2012 16:54:48
avast! - copyright (c) 1988-2012 AVAST Software.
http://www.avast.com

--
You received this message because you are subscribed to the Google
Groups "tronixstuff" group. Thanks!
** To send a new post or reply to the entire group, send email to
tronixstuff@googlegroups.com **
** To privately email the group manager, send email to j...@tronixstuff.com
To unsubscribe from this group, send email to
tronixstuff+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/tronixstuff?hl=en

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 120825-0, 25/08/2012
Tested on: 8/25/2012 18:02:39
avast! - copyright (c) 1988-2012 AVAST Software.
http://www.avast.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger Lo  
View profile  
 More options Aug 26 2012, 12:46 am
From: Roger Lo <rogerloh...@gmail.com>
Date: Sun, 26 Aug 2012 12:46:33 +0800
Local: Sun, Aug 26 2012 12:46 am
Subject: Re: [tronixstuff: 2164] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

But how do I let the program read 0x63 as B01100011?
Not quite sure what do you mean, is it similar to recursion?

Roger

On Sun, Aug 26, 2012 at 1:02 AM, Hamilton Elliott <helli...@microflex.ie>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Norman Elliott  
View profile  
 More options Aug 26 2012, 6:15 am
From: Norman Elliott <norman.elli...@gmail.com>
Date: Sun, 26 Aug 2012 03:15:08 -0700 (PDT)
Local: Sun, Aug 26 2012 6:15 am
Subject: Re: [tronixstuff: 2164] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Hi Roger,

Maybe if you think of the arduino only understanding directions in English.
Suppose it needs to be told to go to a certain place. Now if the
instructions were in English it could just do it. What if the instructions
were in French or Spanish. Now we might have written the instructions in
one or other of those languages ( if we knew them ) but the arduino would
not understand. If an interpreter was available they could translate it for
the arduino.

The compiler is like the interpreter. The arduino only stores the
information in binary. However when we write the program we can use various
number formats.  When we verify and upload the code to the arduino our code
is compiled by the compiler part of the IDE into binary and then uploads it
to the arduino. If we write in our code B1100011 then the B tells the
compiler that the 1100011 following it is a binary number so just uses it
to compile the code directly. If we write in our code Ox63 then it
understands that Ox means that the 63 following it is a hexadecimal number
so converts it to binary which means the arduino gets the code it
understands.

I hope this helps you understand.
Norman


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hamilton Elliott  
View profile  
 More options Aug 26 2012, 6:52 am
From: "Hamilton Elliott" <helli...@microflex.ie>
Date: Sun, 26 Aug 2012 11:52:19 +0100
Local: Sun, Aug 26 2012 6:52 am
Subject: RE: [tronixstuff: 2165] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Roger,

A line having:

dots = B01100011;

is exactly the same to the Arduino/compiler as

dots = 0x63;

or

dots = 'c';

or

dots = 99;

You can use whichever form you want and is most convenient. It will produce
the same effect in the program. Don't get hung up on this as your way of
specifying the bit patterns is NOT wrong, it just uses lots of lines and in
MY opinion is harder to read than putting it on less lines.

You could also put each block of 8 bytes on the same line as:

byte dot1[] = { B00000000, B00000000, B00000000, B00000000, B00000000,
B00000000, B00000000, B00000000};

which would also use less lines and be easier to read again in my opinion.
Sorry for getting you confused on this, but I suspect that there was/is a
basic misunderstanding of binary/hex etc that is probably a good thing to
get cleared up.

Recursion is very different. It is having a piece of code run itself. For
instance having a function call itself, possibly repeatedly and is something
to be avoided unless you have a very good reason and not something for
beginners.

Regards,

Hamilton

PS In Norman's reply he uses on example for hex as Ox, it should be 0x (zero
x)

From: tronixstuff@googlegroups.com [mailto:tronixstuff@googlegroups.com] On
Behalf Of Roger Lo
Sent: 26 August 2012 05:47
To: tronixstuff@googlegroups.com
Subject: Re: [tronixstuff: 2165] I used my Arduino to perform an animation
on an 8x8 LED matrix, and the animation stopped at some point but I told it
to goes on forever.

But how do I let the program read 0x63 as B01100011?
Not quite sure what do you mean, is it similar to recursion?

Roger

On Sun, Aug 26, 2012 at 1:02 AM, Hamilton Elliott <helli...@microflex.ie>
wrote:

Roger,

I would use hex because its shorter, each 8 bits can be referenced as
binary, hex or you could also use a character or a decimal number but hex or
binary makes sense in this context. It doesn't matter what way you specify
the values of the 8 bits. B01100011 = 0x63 = 'c' = 99.

Do you understand how to process the array(s) in one loop embedded in the
other?

Regards,

Hamilton

From: tronixstuff@googlegroups.com [mailto:tronixstuff@googlegroups.com] On
Behalf Of Roger Lo
Sent: 25 August 2012 17:09
To: tronixstuff@googlegroups.com
Subject: Re: [tronixstuff: 2163] I used my Arduino to perform an animation
on an 8x8 LED matrix, and the animation stopped at some point but I told it
to goes on forever.

Oh, I understand the checking part. But I can't understand the array. Did
you turn a row in my sketch into a hex number?

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 120825-1, 25/08/2012
Tested on: 8/26/2012 11:52:19
avast! - copyright (c) 1988-2012 AVAST Software.
http://www.avast.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Norman Elliott  
View profile  
 More options Aug 26 2012, 8:36 am
From: Norman Elliott <norman.elli...@gmail.com>
Date: Sun, 26 Aug 2012 05:36:50 -0700 (PDT)
Local: Sun, Aug 26 2012 8:36 am
Subject: Re: [tronixstuff: 2165] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Good catch Hamilton,
Norman

*From:* troni...@googlegroups.com <javascript:> [mailto:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger Lo  
View profile  
 More options Aug 26 2012, 8:53 am
From: Roger Lo <rogerloh...@gmail.com>
Date: Sun, 26 Aug 2012 20:53:24 +0800
Local: Sun, Aug 26 2012 8:53 am
Subject: Re: [tronixstuff: 2169] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Thanks you guys, I understand how to use hex numbers, but Hamilton, what
did you mean by "  process the array(s) in one loop embedded in the other, "
I don't really understand.

Roger

On Sun, Aug 26, 2012 at 8:36 PM, Norman Elliott <norman.elli...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hamilton Elliott  
View profile  
 More options Aug 26 2012, 10:44 am
From: "Hamilton Elliott" <helli...@microflex.ie>
Date: Sun, 26 Aug 2012 15:44:32 +0100
Local: Sun, Aug 26 2012 10:44 am
Subject: RE: [tronixstuff: 2169] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Roger,

If you look at the attachment that I sent a couple of emails back. You will
see that I used two "for" loops, one using i as an index and the other using
i1 as the index and one loop is inside the other. Then I used both i and i1
to reference the dots array as in dots[i][i1] so that it processes the i1
loop eight times for each time it processes the i loop.

Regards,

Hamilton

From: tronixstuff@googlegroups.com [mailto:tronixstuff@googlegroups.com] On
Behalf Of Roger Lo
Sent: 26 August 2012 13:53
To: tronixstuff@googlegroups.com
Subject: Re: [tronixstuff: 2169] I used my Arduino to perform an animation
on an 8x8 LED matrix, and the animation stopped at some point but I told it
to goes on forever.

Thanks you guys, I understand how to use hex numbers, but Hamilton, what did
you mean by "  process the array(s) in one loop embedded in the other, " I
don't really understand.

Roger

On Sun, Aug 26, 2012 at 8:36 PM, Norman Elliott <norman.elli...@gmail.com>
wrote:

On Sunday, 26 August 2012 11:52:19 UTC+1, Hamilton wrote:

Roger,

A line having:

dots = B01100011;

is exactly the same to the Arduino/compiler as

dots = 0x63;

or

dots = 'c';

or

dots = 99;

You can use whichever form you want and is most convenient. It will produce
the same effect in the program. Don't get hung up on this as your way of
specifying the bit patterns is NOT wrong, it just uses lots of lines and in
MY opinion is harder to read than putting it on less lines.

You could also put each block of 8 bytes on the same line as:

byte dot1[] = { B00000000, B00000000, B00000000, B00000000, B00000000,
B00000000, B00000000, B00000000};

which would also use less lines and be easier to read again in my opinion.
Sorry for getting you confused on this, but I suspect that there was/is a
basic misunderstanding of binary/hex etc that is probably a good thing to
get cleared up.

Recursion is very different. It is having a piece of code run itself. For
instance having a function call itself, possibly repeatedly and is something
to be avoided unless you have a very good reason and not something for
beginners.

Regards,

Hamilton

PS In Norman's reply he uses on example for hex as Ox, it should be 0x (zero
x)

Good catch Hamilton,

Norman

From: troni...@googlegroups.com [mailto:troni...@googlegroups.com] On Behalf
Of Roger Lo

Sent: 26 August 2012 05:47

To: troni...@googlegroups.com

Subject: Re: [tronixstuff: 2165] I used my Arduino to perform an animation
on an 8x8 LED matrix, and the animation stopped at some point but I told it
to goes on forever.

But how do I let the program read 0x63 as B01100011?
Not quite sure what do you mean, is it similar to recursion?

Roger

On Sun, Aug 26, 2012 at 1:02 AM, Hamilton Elliott <hell...@microflex.ie>
wrote:

Roger,

I would use hex because its shorter, each 8 bits can be referenced as
binary, hex or you could also use a character or a decimal number but hex or
binary makes sense in this context. It doesn't matter what way you specify
the values of the 8 bits. B01100011 = 0x63 = 'c' = 99.

Do you understand how to process the array(s) in one loop embedded in the
other?

Regards,

Hamilton

From: troni...@googlegroups.com [mailto:troni...@googlegroups.com] On Behalf
Of Roger Lo

Sent: 25 August 2012 17:09

To: troni...@googlegroups.com

Subject: Re: [tronixstuff: 2163] I used my Arduino to perform an animation
on an 8x8 LED matrix, and the animation stopped at some point but I told it
to goes on forever.

Oh, I understand the checking part. But I can't understand the array. Did
you turn a row in my sketch into a hex number?

  _____  

avast! Antivirus <http://www.avast.com> : Outbound message clean.

Virus Database (VPS): 120825-1, 25/08/2012
Tested on: 8/26/2012 11:52:19
avast! - copyright (c) 1988-2012 AVAST Software.

--
You received this message because you are subscribed to the Google
Groups "tronixstuff" group. Thanks!
** To send a new post or reply to the entire group, send email to
tronixstuff@googlegroups.com **
** To privately email the group manager, send email to j...@tronixstuff.com
To unsubscribe from this group, send email to
tronixstuff+unsubscribe@googlegroups.com
<mailto:tronixstuff%2Bunsubscribe@googlegroups.com>
For more options, visit this group at
http://groups.google.com/group/tronixstuff?hl=en

--
You received this message because you are subscribed to the Google
Groups "tronixstuff" group. Thanks!
** To send a new post or reply to the entire group, send email to
tronixstuff@googlegroups.com **
** To privately email the group manager, send email to j...@tronixstuff.com
To unsubscribe from this group, send email to
tronixstuff+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/tronixstuff?hl=en

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 120826-0, 26/08/2012
Tested on: 8/26/2012 15:44:32
avast! - copyright (c) 1988-2012 AVAST Software.
http://www.avast.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger Lo  
View profile  
 More options Aug 26 2012, 11:56 am
From: Roger Lo <rogerloh...@gmail.com>
Date: Sun, 26 Aug 2012 23:56:24 +0800
Local: Sun, Aug 26 2012 11:56 am
Subject: Re: [tronixstuff: 2170] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Hamilton,
Oh, I understand now. Thank you all for the help.

Roger

On Sun, Aug 26, 2012 at 10:44 PM, Hamilton Elliott <helli...@microflex.ie>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hamilton Elliott  
View profile   Translate to Translated (View Original)
 More options Aug 26 2012, 1:45 pm
From: "Hamilton Elliott" <helli...@microflex.ie>
Date: Sun, 26 Aug 2012 18:45:10 +0100
Local: Sun, Aug 26 2012 1:45 pm
Subject: RE: [tronixstuff: 2171] I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Hi Roger,

Let us know how the project works out and if you have any more questions -
ask.

Regards,

Hamilton

From: tronixstuff@googlegroups.com [mailto:tronixstuff@googlegroups.com] On
Behalf Of Roger Lo
Sent: 26 August 2012 16:56
To: tronixstuff@googlegroups.com
Subject: Re: [tronixstuff: 2171] I used my Arduino to perform an animation
on an 8x8 LED matrix, and the animation stopped at some point but I told it
to goes on forever.

Hamilton,
Oh, I understand now. Thank you all for the help.

Roger

On Sun, Aug 26, 2012 at 10:44 PM, Hamilton Elliott <helli...@microflex.ie>
wrote:

Roger,

If you look at the attachment that I sent a couple of emails back. You will
see that I used two "for" loops, one using i as an index and the other using
i1 as the index and one loop is inside the other. Then I used both i and i1
to reference the dots array as in dots[i][i1] so that it processes the i1
loop eight times for each time it processes the i loop.

Regards,

Hamilton

From: tronixstuff@googlegroups.com [mailto:tronixstuff@googlegroups.com] On
Behalf Of Roger Lo
Sent: 26 August 2012 13:53
To: tronixstuff@googlegroups.com
Subject: Re: [tronixstuff: 2169] I used my Arduino to perform an animation
on an 8x8 LED matrix, and the animation stopped at some point but I told it
to goes on forever.

Thanks you guys, I understand how to use hex numbers, but Hamilton, what did
you mean by "  process the array(s) in one loop embedded in the other, " I
don't really understand.

Roger

On Sun, Aug 26, 2012 at 8:36 PM, Norman Elliott <norman.elli...@gmail.com>
wrote:

On Sunday, 26 August 2012 11:52:19 UTC+1, Hamilton wrote:

Roger,

A line having:

dots = B01100011;

is exactly the same to the Arduino/compiler as

dots = 0x63;

or

dots = 'c';

or

dots = 99;

You can use whichever form you want and is most convenient. It will produce
the same effect in the program. Don't get hung up on this as your way of
specifying the bit patterns is NOT wrong, it just uses lots of lines and in
MY opinion is harder to read than putting it on less lines.

You could also put each block of 8 bytes on the same line as:

byte dot1[] = { B00000000, B00000000, B00000000, B00000000, B00000000,
B00000000, B00000000, B00000000};

which would also use less lines and be easier to read again in my opinion.
Sorry for getting you confused on this, but I suspect that there was/is a
basic misunderstanding of binary/hex etc that is probably a good thing to
get cleared up.

Recursion is very different. It is having a piece of code run itself. For
instance having a function call itself, possibly repeatedly and is something
to be avoided unless you have a very good reason and not something for
beginners.

Regards,

Hamilton

PS In Norman's reply he uses on example for hex as Ox, it should be 0x (zero
x)

Good catch Hamilton,

Norman

From: troni...@googlegroups.com [mailto:troni...@googlegroups.com] On Behalf
Of Roger Lo

Sent: 26 August 2012 05:47

To: troni...@googlegroups.com

Subject: Re: [tronixstuff: 2165] I used my Arduino to perform an animation
on an 8x8 LED matrix, and the animation stopped at some point but I told it
to goes on forever.

But how do I let the program read 0x63 as B01100011?
Not quite sure what do you mean, is it similar to recursion?

Roger

On Sun, Aug 26, 2012 at 1:02 AM, Hamilton Elliott <hell...@microflex.ie>
wrote:

Roger,

I would use hex because its shorter, each 8 bits can be referenced as
binary, hex or you could also use a character or a decimal number but hex or
binary makes sense in this context. It doesn't matter what way you specify
the values of the 8 bits. B01100011 = 0x63 = 'c' = 99.

Do you understand how to process the array(s) in one loop embedded in the
other?

Regards,

Hamilton

From: troni...@googlegroups.com [mailto:troni...@googlegroups.com] On Behalf
Of Roger Lo

Sent: 25 August 2012 17:09

To: troni...@googlegroups.com

Subject: Re: [tronixstuff: 2163] I used my Arduino to perform an animation
on an 8x8 LED matrix, and the animation stopped at some point but I told it
to goes on forever.

Oh, I understand the checking part. But I can't understand the array. Did
you turn a row in my sketch into a hex number?

  _____  

avast! Antivirus <http://www.avast.com> : Outbound message clean.

Virus Database (VPS): 120825-1, 25/08/2012
Tested on: 8/26/2012 11:52:19
avast! - copyright (c) 1988-2012 AVAST Software.

--
You received this message because you are subscribed to the Google
Groups "tronixstuff" group. Thanks!
** To send a new post or reply to the entire group, send email to
tronixstuff@googlegroups.com **
** To privately email the group manager, send email to j...@tronixstuff.com
To unsubscribe from this group, send email to
tronixstuff+unsubscribe@googlegroups.com
<mailto:tronixstuff%2Bunsubscribe@googlegroups.com>
For more options, visit this group at
http://groups.google.com/group/tronixstuff?hl=en

--
You received this message because you are subscribed to the Google
Groups "tronixstuff" group. Thanks!
** To send a new post or reply to the entire group, send email to
tronixstuff@googlegroups.com **
** To privately email the group manager, send email to j...@tronixstuff.com
To unsubscribe from this group, send email to
tronixstuff+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/tronixstuff?hl=en

--
You received this message because you are subscribed to the Google
Groups "tronixstuff" group. Thanks!
** To send a new post or reply to the entire group, send email to
tronixstuff@googlegroups.com **
** To privately email the group manager, send email to j...@tronixstuff.com
To unsubscribe from this group, send email to
tronixstuff+unsubscribe@googlegroups.com
<mailto:tronixstuff%2Bunsubscribe@googlegroups.com>
For more options, visit this group at
http://groups.google.com/group/tronixstuff?hl=en

--
You received this message because you are subscribed to the Google
Groups "tronixstuff" group. Thanks!
** To send a new post or reply to the entire group, send email to
tronixstuff@googlegroups.com **
** To privately email the group manager, send email to j...@tronixstuff.com
To unsubscribe from this group, send email to
tronixstuff+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/tronixstuff?hl=en

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 120826-0, 26/08/2012
Tested on: 8/26/2012 18:45:11
avast! - copyright (c) 1988-2012 AVAST Software.
http://www.avast.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Don  
View profile  
 More options Aug 26 2012, 9:16 pm
From: Don <kc9...@gmail.com>
Date: Sun, 26 Aug 2012 18:16:44 -0700 (PDT)
Local: Sun, Aug 26 2012 9:16 pm
Subject: Re: I used my Arduino to perform an animation on an 8x8 LED matrix, and the animation stopped at some point but I told it to goes on forever.

Hi Roger, I don't know much about how this works but couldn't you use
output compare interrupt to load the next pattern? If you use Timer 1 It
could be use to make a 100ms delay to show pattern.
Don


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »