Show Posts
Pages: 1 ... 21 22 [23] 24 25 ... 85
331  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.
332  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
333  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.
334  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?
335  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.
336  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.
337  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.
338  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);
}
339  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.

340  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.
341  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?
342  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.


343  Using Arduino / Sensors / Re: Color Sensor TCS230 on: December 12, 2013, 03:49:09 pm
The sensors need to be calibrated in your software. If you look at the pdf that comes with a library that I wrote for the sensor, you can see an explanation of how you can do that. The library is in my code repository (link below in the signature). Once calibrated they are pretty good at discriminating colors.
344  Using Arduino / Sensors / Re: New library for TCS230 RGB Color Sensor on: December 12, 2013, 03:46:26 pm
You can connect the sensor to any pin as long as you tell the library which one is which when you create the object - please read the documentation PDF that comes with the library.

The one exception is the frequency reading pin. From the header file:

Quote
  This library has a dependency on the FreqCount library for frequency counting. FreqCount library is available at  http://www.pjrc.com/teensy/td_libs_FreqCount.html
   
  ** IMPORTANT NOTE**
  FreqCount imposes a limitation that the frequency can only be counted on specific pins and limits the use of other pins as   follows:
  Board       Input Pin Pins Unusable with analogWrite()
  ----------- --------- -------------------------------- 
  Arduino Uno      5      3, 9, 10, 11
  Arduino 2009    5      3, 9, 10, 11
  Arduino Mega    47    9, 10, 44, 45, 46
  Sanguino            1      12, 13, 14, 15
345  Using Arduino / Audio / Re: MIDI library conflict? on: December 12, 2013, 03:24:18 pm
Stop using the serial port for prints if your using it for midi. You just cannot do that. If one library (midi) is using a resource it is unavailable to the other code.
Pages: 1 ... 21 22 [23] 24 25 ... 85