Show Posts
Pages: 1 ... 21 22 [23] 24 25 ... 85
331  Using Arduino / LEDs and Multiplexing / Re: limit rows on MAX7219 for matrix display ? on: December 13, 2013, 06:51:10 pm
5x8 would come from the scan limit, 5x7 comes from not wiring one of the bits.

Parola library sits over the top of the 'hardware' library MD_MAX72xx. This library has recently been upgraded to allow use with the more generic hardware available on eBay and other sources (which is basically 'flipped' 90 degrees). One or other modes may suit, depends on the actual details of the wiring. I figure for the cost of a download and a compile of the test program (which exercises the scan limit) it is worth a try. If it does not work no-one is worse off :-)
332  Using Arduino / LEDs and Multiplexing / Re: limit rows on MAX7219 for matrix display ? on: December 13, 2013, 04:22:42 pm
Try using the MD_MAX72XX library (link in the repository below). My Parola modules are probably wired the same way as your matrix and you may find that the scan limit works the way you expect.
333  Using Arduino / Audio / Re: MIDI library conflict? on: December 13, 2013, 04:18:07 pm
The MEGA has more RAM and more program memory as well. It also has a lot more I/O pins.

166 bytes left over is fine if it never changes. It means that you have enough RAM. Remember that you don't needs lots, you just need enough. There are things you can do (like use flash RAM to store strings, making loop counters uint8 instead of int) that will increase the amount of RAM available for other things.

RAM is used by 2 things - one is the program stack and the other the memory heap. The stack usually grows from the bottom up and the heap is allocated from the top down. So if you run out of space, the stack and the heap collide in the middle.

The stack hold all the temporary variables that are being used by a function when it is called and the return address. So, having lots of nested function calls and/or lots of temporary variables makes the stack grow faster.

Most libraries, if they use RAM, will have allocated all they need after the setup() or begin() type routines. Some, however, will allocate memory as required, and this is where the 166 bytes may cause issues. I know that MIDIFile will not allocate additional RAM, and you should look at the MIDI library for malloc(), alloc() or new() function calls, and when they occur.

Unfortunately, when you use someone else's library this stuff is hard to determine and depends on the skill of the library builder (which in many cases is not high, in Arduino land). Remember too that adding debugging messages takes up space and may sometimes be the cause of problems, especially when you are close to full RAM usage.

If you have removed the strings as suggested and you now see more free RAM available, but still see the 'reset' problems, then I am guessing that it is probably not RAM starvation but something else.
334  Using Arduino / Sensors / Re: Color Sensor TCS230 on: December 13, 2013, 01:17:55 pm
From the documentation:
Quote
MD_TCS230(uint8_t s2, uint8_t s3);
MD_TCS230(uint8_t s2, uint8_t s3, uint8_t oe);
MD_TCS230(uint8_t s2, uint8_t s3, uint8_t s0, uint8_t s1);
MD_TCS230(uint8_t s2, uint8_t s3, uint8_t s0, uint8_t s1, uint8_t oe);

Various forms of the constructor for this class. The parameters are all the Arduino pin numbers used to control the nominated pins on the TCS230. The form used will depend on the configuration of the hardware connections to the Arduino. At a minimum S2 and S3 are required for color filter selection.

You can either use a constructor that includes the S0, S1 pins in the constructor, and the library will use them. If you don't specify them to the library then it is up to you to connected them to either GND or +5V. To see which makes sense in you situation, you need to look at the datasheet for the device and set accordingly.
335  Using Arduino / Audio / Re: MIDI library conflict? on: December 13, 2013, 01:11:41 pm
Quote
I have a feeling the 2nd SD.begin is not needed.

Definitely
336  Using Arduino / Sensors / Re: Color Sensor TCS230 on: December 13, 2013, 05:55:53 am
So now look at the example program you are running and check that the object is created with the same Pin numbers.
337  Using Arduino / Sensors / Re: Color Sensor TCS230 on: December 13, 2013, 05:47:14 am
You pick some pins and connect them to the sensor. Then you tell the library which pins you have picked for s0, s1, etc. there is a PDF that explains the library, have you read it?
338  Using Arduino / Sensors / Re: Color Sensor TCS230 on: December 13, 2013, 05:39:20 am
Pin connections do not matter as long as they match what you tell the library when you start. The only pin that is important is the frequency pin, so make sure you are using the right pin as per the header file table.
339  Using Arduino / Sensors / Re: Color Sensor TCS230 on: December 13, 2013, 04:43:26 am
If the result is what you see on the serial output then you need to make sure that the bit per second are the same as what the serial .begin is setting.
340  Using Arduino / Audio / Re: LDR with logic pro 9 (midi trigger) on: December 13, 2013, 03:27:07 am
I would really suggest that you experiment with the LDR to see what values you get back under certain conditions. Then you can make decisions about when and how the MIDI will be triggered.
341  Using Arduino / Audio / Re: LDR with logic pro 9 (midi trigger) on: December 12, 2013, 08:17:07 pm
Not sure what version of Arduino IDE you are using on the Mac, but it appears different from mine on Windows.

Your code does not compile with the Windows 1.0.5 version. You need to change MIDI_TX as follows:

Code:
//*******************************************************************************************************************
// Transmit MIDI Message
//*******************************************************************************************************************
void MIDI_TX(uint8_t MESSAGE, uint8_t PITCH, uint8_t VELOCITY)
{
  //status = MESSAGE + midichannel;
  //status = MESSAGE + pin;
  digitalWrite(13,HIGH);
  Serial.write(MESSAGE);
  Serial.write(PITCH);
  Serial.write(VELOCITY);
  delay(30);
  digitalWrite(13,LOW);
}
342  Using Arduino / Audio / Re: MIDI library conflict? on: December 12, 2013, 08:07:25 pm
Quote
I'm not really sure by what you mean when you wrote "that would make it stop".  What would make it stop?

This is an infinite loop that executes if there is an error:
Code:
while (true) ;

That would make the Arduino stop, especially if you say that the setup() seems to be where the code stops.

Quote
I believe the sketch is stopping around   err = SMF.load();.   

This is actually in loop() and not in setup(), so you are contradicting previous information.

Quote
So I'm guessing that means I'm running out of memory?

It is possible. 166 bytes is not a lot and the libraries could be allocating memory. Free up memory as suggested previously and see if it works.

343  Using Arduino / Audio / Re: MIDI library conflict? on: December 12, 2013, 04:22:45 pm
Code:
  if (!SD.begin(SD_SELECT, SPI_HALF_SPEED))
  {
  //  DEBUG("\nSD init fail!");
    digitalWrite(SD_ERROR_LED, HIGH);
    while (true) ;
  }

This would make it stop.

Are you sure you have enough RAM to run all of this? You could be running out of memory - you only have 2kB RAM on the Arduino.

Make the list of files shorter (just one file) by commenting out the rest. This will free up the amount of RAM taken by the strings.
344  Using Arduino / Audio / Re: MIDI library conflict? on: December 12, 2013, 03:58:25 pm
Quote
2a.  using same sketch, add the MIDI.h library to the sketch, upload it
result:  fail

Unclear as to what a pass or fail means here. Did it fail to just compile? or upload? Did it not run? Which bit did not run?
345  Using Arduino / Audio / Re: LDR with logic pro 9 (midi trigger) on: December 12, 2013, 03:55:09 pm
If you have been working for months and still have nothing to show then I would you may have been doing too much at once. IMHO think that your approach should be to
1. Try and get the LDR code working first - just read the LDR value and print it out. Lots of examples to follow on this.
2. Decide what you want the MIDI to do with the LDR value?
3. UNderstand how you can send a MIDI message out the Arduino serial port. Again many examples on this.
4. Build the message YOU want to send and put that through the serial output.


Pages: 1 ... 21 22 [23] 24 25 ... 85