Show Posts
Pages: [1] 2 3 ... 6
1  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Occasional "Couldn't determine program size" error on: April 20, 2009, 07:12:54 pm
*facepalm*

(sorry for being so... inept with code. i hope this'll teach me a lesson =P )
2  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Occasional "Couldn't determine program size" error on: April 20, 2009, 06:46:39 pm
err... running windows,

this is my error message:

o: In function `main':
C:\DOCUME~1\Family\LOCALS~1\Temp\build25321.tmp/Temporary_8204_6203.cpp:39: undefined reference to `setup'


Couldn't determine program size: C:\Documents and Settings\Family\My Documents\Arduino\arduino-0015-win\arduino-0015\hardware/tools/avr/bin/avr-size: 'C:\DOCUME~1\Family\LOCALS~1\Temp\build25321.tmp\Knight_Rider.hex': No such file

and i have no "info.plist" so... uhhh... yeah. any help with this?
3  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Occasional "Couldn't determine program size" error on: April 19, 2009, 10:53:49 pm
I have this problem 100% of the time--it sucks. i can't get anything onto the board. Someone mentioned a patch, i tried it, but i couldn't get it working--how do you get the patch to work? does it work? i'm at a loss here--help would be much appreciated.
4  Forum 2005-2010 (read only) / Syntax & Programs / Re: Simple Array Usage on: May 02, 2009, 12:38:05 pm
Quote
This is almost correct. I'll just point out a few things:

    * You don't *really* need line 1. This can be handled in your for() loop setup. (and you're already [almost] handling it anyway.
    * Change for (cycle>28; to for( cycle = 29;. This change will tell your for loop 'start this loop by setting the value of the variable cycle to 29.'
    * Similarly for lines 3 and 4, you don't need line 3, and start line 4 off with for( count = 13;.
    * A personal touch, instead of using count>-1; on line 4, you can use count >= 0;. I feel this is a nicer way to specify the same thing, as it's easier to read that 'this is what it's doing.' You also have the added benefit of eliminating problems that may occur with float numbers. For example, if you are counting down from 10.5, you go 10.5, 9.5, 8.5, ... 1.5, 0.5, -0.5, -1.5. It won't get picked up until it hits -1.5. So using count >= 0; is also a little more specific.

I've gotten rid of line one; that was from changing the amount of times each pattern would repeat and i forgot to actually fix it rather than changing the parameters in the for ()... because i was lazy...

I've done the second and third parts you've suggested, it works fine as well.

And finally changing count > -1 to count >= 0 had everything working properly.

The code beforehand was working great, but i guess it wasn't working how it SHOULD have been. But now everything is in order and squared away. Thanks for your help, everyone!
5  Forum 2005-2010 (read only) / Syntax & Programs / Re: Simple Array Usage on: May 01, 2009, 10:02:13 am
Quote
Looking at the whole sketch it probably does work, but those "cycle > 34" bits don't do anything.

Andrew

i'm not at home now so i can't test out a modified code, but i see what you mean there. And thanks for the help, Anachrocomputer, it looks like that could help me.

(as it is now, the code runs fine and does what I want, but looking at the code and explaining it to someone is made more difficult when it's messy like that)

EDIT: turns out i do need the for (cycle>34;cycle<55;cycle++){ parts (Specifically the cycle>34;). If they aren't there, the syntax for the for command is incomplete and does not work properly.

For the part about turning on/off all at once, what was suggested worked, and now the code is a lot nicer. Thanks for your help!
6  Forum 2005-2010 (read only) / Syntax & Programs / Simple Array Usage on: April 30, 2009, 08:35:31 pm
Hello, I'm coding a line of 14 LEDs (we all love blinking LEDs, right?) and i'm controlling them using an array. That's all great, but for the instances where I individually control the LEDs, the code gets messy (having 14 lines of code for turning them on, 14 for off again). Is there a way to control multiple values in the array using one line of code?

(here's the code i have):

Code:
int pinArray[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
int count = 0;
int timer = 30;
int cycle = 10;

void setup(){  //This sets up the program
  for (count=0;count<13;count++) {
    pinMode(pinArray[count], OUTPUT);
  }
}

void loop() {  //This section turns all LEDs on in consecutive order, then off in order. Then it goes back the same way
  for (cycle=0;cycle<9;cycle++){
    for (count=0;count<14;count++) {
      digitalWrite(pinArray[count], HIGH);
      delay(timer);
    }
    count=0;
    for (count=0;count<14;count++) {
      digitalWrite(pinArray[count], LOW);
      delay(timer);
    }
    for (count=13;count>=0;count--) {
      digitalWrite(pinArray[count], HIGH);
      delay(timer);
    }
    count=13;
    for (count=13;count>=0;count--) {
      digitalWrite(pinArray[count], LOW);
      delay(timer);
    }
  }
  for (cycle>8;cycle<19;cycle++){  //This section blinks two lit LEDs across the faceplate and back
    for (count=0;count<13;count++) {
      digitalWrite(pinArray[count], HIGH);
      delay(timer/2);
      digitalWrite(pinArray[count + 1], HIGH);
      delay(timer/2);
      digitalWrite(pinArray[count], LOW);
      delay(timer);
    }
    for (count=13;count>-1;count--) {
      digitalWrite(pinArray[count], HIGH);
      delay(timer/2);
      digitalWrite(pinArray[count - 1], HIGH);
      delay(timer/2);
      digitalWrite(pinArray[count], LOW);
      delay(timer/2);
    }
  }
  cycle = 29; //This section blinks on LEDs then off, and waits to blink the next one
  for (cycle>28;cycle<34;cycle++){
    count = 13;
    for (count<14;count>-1;count--){
      digitalWrite(pinArray[count], HIGH);
      delay(timer*2);
      digitalWrite(pinArray[count], LOW);
      delay(timer*10);
    }
  }
  for (cycle>34;cycle<55;cycle++){  //This section scrolls four sets of two lit LEDs across
    digitalWrite(pinArray[2], LOW);
    digitalWrite(pinArray[6], LOW);
    digitalWrite(pinArray[10], LOW);
    digitalWrite(pinArray[0], HIGH);
    digitalWrite(pinArray[4], HIGH);
    digitalWrite(pinArray[8], HIGH);
    digitalWrite(pinArray[12], HIGH);
    delay(timer*6);
    digitalWrite(pinArray[3], LOW);
    digitalWrite(pinArray[7], LOW);
    digitalWrite(pinArray[11], LOW);
    digitalWrite(pinArray[1], HIGH);
    digitalWrite(pinArray[5], HIGH);
    digitalWrite(pinArray[9], HIGH);
    digitalWrite(pinArray[13], HIGH);
    delay(timer*6);
    digitalWrite(pinArray[0], LOW);
    digitalWrite(pinArray[4], LOW);
    digitalWrite(pinArray[8], LOW);
    digitalWrite(pinArray[12], LOW);
    digitalWrite(pinArray[2], HIGH);
    digitalWrite(pinArray[6], HIGH);
    digitalWrite(pinArray[10], HIGH);
    delay(timer*6);
    digitalWrite(pinArray[1], LOW);
    digitalWrite(pinArray[5], LOW);
    digitalWrite(pinArray[9], LOW);
    digitalWrite(pinArray[13], LOW);
    digitalWrite(pinArray[3], HIGH);
    digitalWrite(pinArray[7], HIGH);
    digitalWrite(pinArray[11], HIGH);
    delay(timer*6);
  }
  for (cycle>54;cycle<65;cycle++){  //This section blinks all LEDs on and off together
    digitalWrite(pinArray[0], HIGH);
    digitalWrite(pinArray[1], HIGH);
    digitalWrite(pinArray[2], HIGH);
    digitalWrite(pinArray[3], HIGH);
    digitalWrite(pinArray[4], HIGH);
    digitalWrite(pinArray[5], HIGH);
    digitalWrite(pinArray[6], HIGH);
    digitalWrite(pinArray[7], HIGH);
    digitalWrite(pinArray[8], HIGH);
    digitalWrite(pinArray[9], HIGH);
    digitalWrite(pinArray[10], HIGH);
    digitalWrite(pinArray[11], HIGH);
    digitalWrite(pinArray[12], HIGH);
    digitalWrite(pinArray[13], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[0], LOW);
    digitalWrite(pinArray[1], LOW);
    digitalWrite(pinArray[2], LOW);
    digitalWrite(pinArray[3], LOW);
    digitalWrite(pinArray[4], LOW);
    digitalWrite(pinArray[5], LOW);
    digitalWrite(pinArray[6], LOW);
    digitalWrite(pinArray[7], LOW);
    digitalWrite(pinArray[8], LOW);
    digitalWrite(pinArray[9], LOW);
    digitalWrite(pinArray[10], LOW);
    digitalWrite(pinArray[11], LOW);
    digitalWrite(pinArray[12], LOW);
    digitalWrite(pinArray[13], LOW);
    delay(timer*10);
  }
  if (cycle = 65){  //This section blinks on all LEDs one at a time, then off one at a time.
    digitalWrite(pinArray[3], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[8], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[4], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[10], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[5], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[1], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[9], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[0], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[11], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[2], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[7], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[13], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[6], HIGH);
    delay(timer*10);
    digitalWrite(pinArray[12], HIGH);
    delay(timer*100);
    digitalWrite(pinArray[5], LOW);
    delay(timer*10);
    digitalWrite(pinArray[12], LOW);
    delay(timer*10);
    digitalWrite(pinArray[3], LOW);
    delay(timer*10);
    digitalWrite(pinArray[7], LOW);
    delay(timer*10);
    digitalWrite(pinArray[1], LOW);
    delay(timer*10);
    digitalWrite(pinArray[9], LOW);
    delay(timer*10);
    digitalWrite(pinArray[11], LOW);
    delay(timer*10);
    digitalWrite(pinArray[2], LOW);
    delay(timer*10);
    digitalWrite(pinArray[8], LOW);
    delay(timer*10);
    digitalWrite(pinArray[10], LOW);
    delay(timer*10);
    digitalWrite(pinArray[0], LOW);
    delay(timer*10);
    digitalWrite(pinArray[13], LOW);
    delay(timer*10);
    digitalWrite(pinArray[6], LOW);
    delay(timer*10);
    digitalWrite(pinArray[4], LOW);
    delay(timer*100);
    cycle = 0;
  }
}
7  Forum 2005-2010 (read only) / Workshops / Re: My first real RC truck project LED Arduino on: May 10, 2009, 06:17:43 pm
Quote
void setup()                      // run once, when the sketch starts
{
 for (count=0; count<6; count++)  // setup the pins for output
 {
  pinMode(lightArray[count], OUTPUT);
 }
 Serial.begin(9600);            // tell arduino to start up serial comms
}

The for line makes the variable count go through all 6 times (rather than declaring pinmode(lightArray[1], OUTPUT), then the next line would be lightArray[2], etc), and the line starting with pinMode sets the data indexed as count in the array "lightArray" as an output pin.

Serial.begin(9600) starts the arduino talking to a computer at a set rate.
8  Forum 2005-2010 (read only) / Exhibition / Re: Arduino Scrolling 56x8 LED matrix on: June 07, 2010, 12:16:27 pm
I'm intrigued, can you post code for that? maybe a quick sketch of how the 595s are hooked up to each other as well?
9  Forum 2005-2010 (read only) / Exhibition / Re: Great big shield! (arduino synth) on: April 29, 2010, 11:59:02 pm
I'm impressed. Entirely. How long/how much money did it take you to do this? What did you design the PCB in? How did you manufacture it--Fab house? Well put together video by the way.
10  Forum 2005-2010 (read only) / Exhibition / Re: Nobody should stop making 8x8 LED matricies. Ever. on: May 29, 2010, 12:00:58 pm
To do that, you need to take a look here:

http://www.arduino.cc/playground/Main/DirectDriveLEDMatrix

Basically, the only part of my project that you would use is the matrix, which you can build yourself or buy one. If you have any questions after you look at that link, let me know and I'll try to help
11  Forum 2005-2010 (read only) / Exhibition / Re: Nobody should stop making 8x8 LED matricies. Ever. on: May 02, 2010, 01:46:00 pm
Yes I would recommend using one shift register to control the rows, another for the columns. As it is now, the code should still work, kinda, if you just limit your window from an 8x8 to a 5x7 for the characters. I think it should scroll still if you adjust code accordingly, but i haven't given it too much thought. If you run into a specific problem along the way let me know.
12  Forum 2005-2010 (read only) / Exhibition / Re: Nobody should stop making 8x8 LED matricies. Ever. on: May 01, 2010, 11:26:39 am
Ok, here's code:

Code:
#include <TimerOne.h>    //Download the TimerOne library if you haven't already
int StoreClock = 13;     //Pin connected to Pin 12 of 74HC595 (Latch)
int ShiftClock = 12;    //Pin connected to Pin 11 of 74HC595 (Clock)
int dataPin = 11;       //Pin connected to Pin 14 of 74HC595 (Data)
int displaySize = 74;   //How many bytes are in the StoreDisplay array
uint8_t StoreDisplay[74];  //Stored bytes to be output
uint8_t ActiveDisplay[8];  //Bytes that represent what is actually being displayed
long counter1 = 0;   //Counter which is used to change the display
int active = 4; //This will change every so often in order to move the display

void setup() {
  pinMode(StoreClock, OUTPUT);   //set pins to output
  pinMode(ShiftClock, OUTPUT);
  pinMode(dataPin, OUTPUT);
  StoreDisplay[0] = B00000000;  //What's going to be output in bytes
  StoreDisplay[1] = B00000000;
  StoreDisplay[2] = B00000000;
  StoreDisplay[3] = B00000000;
  StoreDisplay[4] = B00000000;
  StoreDisplay[5] = B00000000;
  StoreDisplay[6] = B00000000;
  StoreDisplay[7] = B00000000;
  StoreDisplay[8] = B11111111;
  StoreDisplay[9] = B10000001;
  StoreDisplay[10] = B10000001;
  StoreDisplay[11] = B01000010;
  StoreDisplay[12] = B00111100;
  StoreDisplay[13] = B00000000;
  StoreDisplay[14] = B00000000;
  StoreDisplay[15] = B11111000;
  StoreDisplay[16] = B00010111;
  StoreDisplay[17] = B00010001;
  StoreDisplay[18] = B00010111;
  StoreDisplay[19] = B11111000;
  StoreDisplay[20] = B00000000;
  StoreDisplay[21] = B00000000;
  StoreDisplay[22] = B11111111;
  StoreDisplay[23] = B00001001;
  StoreDisplay[24] = B00001001;
  StoreDisplay[25] = B00001001;
  StoreDisplay[26] = B00000001;
  StoreDisplay[27] = B00000000;
  StoreDisplay[28] = B00000000;
  StoreDisplay[29] = B00000001;
  StoreDisplay[30] = B00000001;
  StoreDisplay[31] = B11111111;
  StoreDisplay[32] = B00000001;
  StoreDisplay[33] = B00000001;
  StoreDisplay[34] = B00000000;
  StoreDisplay[35] = B00000000;
  StoreDisplay[36] = B00000000;
  StoreDisplay[37] = B00000000;
  StoreDisplay[38] = B00000000;
  StoreDisplay[39] = B11111111;
  StoreDisplay[40] = B00010001;
  StoreDisplay[41] = B00010001;
  StoreDisplay[42] = B00010001;
  StoreDisplay[43] = B00001110;
  StoreDisplay[44] = B00000000;
  StoreDisplay[45] = B00000000;
  StoreDisplay[46] = B01111111;
  StoreDisplay[47] = B10000000;
  StoreDisplay[48] = B10000000;
  StoreDisplay[49] = B10000000;
  StoreDisplay[50] = B01111111;
  StoreDisplay[51] = B00000000;
  StoreDisplay[52] = B00000000;
  StoreDisplay[53] = B11111111;
  StoreDisplay[54] = B00000110;
  StoreDisplay[55] = B00011000;
  StoreDisplay[56] = B01100000;
  StoreDisplay[57] = B11111111;
  StoreDisplay[58] = B00000000;
  StoreDisplay[59] = B00000000;
  StoreDisplay[60] = B11111111;
  StoreDisplay[61] = B00011000;
  StoreDisplay[62] = B00100100;
  StoreDisplay[63] = B01000010;
  StoreDisplay[64] = B10000001;
  StoreDisplay[65] = B00000000;
  StoreDisplay[66] = B00000000;
  StoreDisplay[67] = B00000000;
  StoreDisplay[68] = B00000000;
  StoreDisplay[69] = B00000000;
  StoreDisplay[70] = B00000000;
  StoreDisplay[71] = B00000000;
  StoreDisplay[72] = B00000000;
  StoreDisplay[73] = B00000000;
  StoreDisplay[74] = B00000000;
  Timer1.initialize(10000);              //Start a timer from TimerOne and fire it every 10000 cycles
  Timer1.attachInterrupt(screenUpdate);  //Update the screen every 10000 cycles
}

void loop() {
  counter1++;
  if (counter1 >= 30000) {                        //When counter1 reaches this, change the display image
    counter1 = 0;                                 //Reset the counter first
    for (int i=0; i<8; i++) {
      ActiveDisplay[i]= StoreDisplay[active+i];   //Change what is in the active display based on the variable "active"
    }
    active++;                                     //Change active for the next time counter1 fires this for loop again
    if (active == displaySize-6){                 //Reset active when active increases to this point, making the animation loop again
      active = 0;
    }
  }
}

void screenUpdate() {
  uint8_t row = B00000001;
  for (byte k = 0; k < 9; k++) {
    digitalWrite(StoreClock, LOW);      // Open up the latch ready to receive data
    shiftIt(~row );
    shiftIt(ActiveDisplay[k] );         // StoreDisplay array
    digitalWrite(StoreClock, HIGH);     // Close the latch, sending the data in the registers out to thematrix
    row = row << 1;
  }
}

void shiftIt(byte dataOut) {
  // Shift out 8 bits LSB first,
  // on rising edge of clock
  boolean pinState;
  //clear shift register read for sending data
  digitalWrite(dataPin, LOW);
  // for each bit in dataOut send out a bit
  for (int i=0; i<8; i++) {
    //set ShiftClock to LOW prior to sending bit
    digitalWrite(ShiftClock, LOW);
    // if the value of DataOut and (logical AND) a bitmask
    // are true, set pinState to 1 (HIGH)
    if ( dataOut & (1<<i) ) {
      pinState = HIGH;
    }
    else {
      pinState = LOW;
    }
    //sets dataPin to HIGH or LOW depending on pinState
    digitalWrite(dataPin, pinState);
    //send bit out on rising edge of clock
    digitalWrite(ShiftClock, HIGH);
    digitalWrite(dataPin, LOW);
  }
  digitalWrite(ShiftClock, LOW);   //stop shifting
}
13  Forum 2005-2010 (read only) / Exhibition / Re: Nobody should stop making 8x8 LED matricies. Ever. on: April 30, 2010, 11:25:44 pm
Thanks! Oh hey i just read and replied to your post in the FAQ place before I read this. Yeah I can post code, probably late tomorrow because I want to annotate it before I put it out (It's basically the same as the ASK manual, except for the scrolling part) I would recommend using a premade matrix as making your own is pretty messy, but it's a good experience to see what actually makes it work. I actually made mine just because I had them laying around collecting dust. Either way, I'll post code soon (tomorrow, maybe tomorrow night).
14  Forum 2005-2010 (read only) / Exhibition / Nobody should stop making 8x8 LED matricies. Ever. on: April 25, 2010, 01:22:23 pm
Well, it's about time i finished this project. Finally, have an 8x8 LED matrix to play around with and I become a fully-fledged member of the arduino community. Here are the details:

  • It's monocolor red
  • controlled by two 74HC595 shift registers.
  • It's run off three pins from the arduino controlling the two shift registers.
  • The code work is modified from the ASK manual by earthshine design.

Video and pictures (below the joule thief picture) http://randomthingsitinker.blogspot.com/2010/04/what-ive-been-doing.html

Everything is running fine; the only thing left is to refine the code for it to make changing the display pattern easier. If anyone wants me to list the code just ask for it and I will.

Improvements for next time: hook the anodes up to either a transistor or a P-FET, and ground to a darlington array. And make it bigger. Oh and use diffused LEDs (I had clear ones so I decided to use wax paper over the array to diffuse the light a little and make the image clearer).

questions/comments?
15  Forum 2005-2010 (read only) / Exhibition / Re: An [uncomplete] project development platform on: May 22, 2010, 01:22:44 am
This is actually very impressive! so what made you want to start this project, anyhow? it seems like a rather large undertaking. I can see this being immensely helpful for anyone starting out, or artists that don't want to get too involved in electronics. Overall it seems like a very solid project, but needs a few tweaks and improvements/expansions (no plain resistors on the parts list?). If you can keep developing it, I'd be very excited to see where it can go.
Pages: [1] 2 3 ... 6