Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Troubleshooting / Re: Parallax on: September 04, 2007, 08:06:19 am
Also the servo's?

And does someone know about where to buy IR sensors.(they should pick up IR, the closer the source the higher the value)
and what is this
http://www.parallax.com/detail.asp?product_id=350-00014

Thanks
2  Forum 2005-2010 (read only) / Troubleshooting / Parallax on: September 04, 2007, 06:24:27 am
Hi there every one!

I just wanted to know if all the parallax sensors and things are compatible with the arduino?

Titus
3  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 23, 2009, 03:18:49 pm
7V is quite impossible, given the fact that usb limits it to 5V(so does arduino).
and midi can't be 7 volts!

The "RX pin" andreas, is dat het blauwe draadje wat normaal in de arduino gaat? en zonder led naar 5V?
4  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 23, 2009, 09:56:57 am
Can you please try it without the led?
I don't know where you measured, but my guess is after the voltage drop of the led  ;D
5  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 23, 2009, 04:39:05 am
so what did you do?
what did you replace? what other programs did you upload :O?
6  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 23, 2009, 04:34:17 am
are you experiencing the same as this guy?
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1187962258/53#53
In that case, we've got the same problem.

Did you ever got it working?
I personally think it;s the arduino.
7  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 23, 2009, 04:26:55 am
Tep, do you mean with the arduino connected, or without the arduino connected?
BTW, do you need to declare the Rx pin as an input, to lower the internal pull up/down resistor?

Could the voltage be to low for the Arduino to notice?
In that case you'd suggest lowering the 3k3? or making it bigger?


Andreas, could you measure the Voltage over the rx pin?
8  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 21, 2009, 08:16:11 am
Hi every one,

Today I debugging Andreas his schematics etc.
We made good progress, but got stuck later on.
As mattgilbernet said:

'm also having trouble with this. I've confirmed that midi is coming through the jack by removing the opto-isolator and putting an LED between pins 4 and 5 of the jack. I've confirmed that something is coming through the opto-isolator disconnecting RX and instead putting an LED between +5 and pin 5 of the opto-isolator. It flashes when I hit keys. Ive tried 38400 baud as well. The Arduino is just not receiving the Serial in RX. I've at least narrowed it down, can anyone provide any tips or things to try?

 the LED tests show that everything is working, or at least signals are being passed, all the way up to Arduino's RX pin. At that point the Arduino seems not to recognize the signal.


We tried sending serial data from the pc to the arduino, and that worked. Arduino was able to receive that.

So the big question is:

WHY is arduino not receiving the serial data from my midi signal?
(p.s. the code never gets past the "if (Serial.available() > 0)" part)

THANKS

Titus

EDIT:
@sciguy
http://www.datasheetcatalog.org/datasheet/QT/4N27.pdf
take a look at the schematic of the optocouper's inside on page 1
Your optocoupler has no pin 3 and no pin 6 is my guess
so you'd  only need to skip the 100K Ohm resistor to ground.
The rest is the same
GL Titus
9  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 19, 2009, 09:22:56 am
this code:
Code:
SOMETHING ABOUT MIDI MESSAGES
 midi messages start with one status byte followed by 1 _or_ 2 data bytes, depending on the command

 example midi message: 144-36-100
   the status byte "144" tells us what to do. "144" means "note on".
   in this case the second bytes tells us which note to play (36=middle C)
   the third byte is the velocity for that note (that is how powerful the note was struck= 100)

Well, that was what I wanted to hear!!!!!!!
"http://highlyliquid.com/midi-accessories/midi-connector-inline/midi-jack-inline.jpg is the same, and the other is MIRRORED"

So we will try that smiley-grin

Good luck debugging your things. If i can help(new to midi, but debugged quite a lot of other things. Robotics....
http://www.youtube.com/user/teamvossius

EDIT:
You saw the 36.
Strange that NO ONE mentioned it :O
it is a darn error, I think it is THE error why people weren't getting their stuff to work!
10  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 19, 2009, 09:03:40 am
Hi,
thanks for the fast reply,
dutch smiley-wink
Actually i'm looking at something like this:
http://highlyliquid.com/midi-accessories/midi-connector-inline/midi-plug-inline.jpg
or
http://highlyliquid.com/midi-accessories/midi-connector-inline/midi-jack-inline.jpg

That's why I didn't understand it.
Could you test my led thing? to see if I can find the pinning out that way!

What whould be note on channel 2? 145?
I think so.
So that's something I can test aswell! from 0x90 to 0x9F

I think I'm going to use Hexa codes, easier to understand some things, like kind of action followed by channel
quote from the link:
"where Middle C is note number 60"
I thought we were listening for 36 as the middle c.
there's another strange thing!!!!

I´m starting to understand midi smiley-grin
Actually I'm here to help AndreasViruly with his project smiley-wink
list with all commands, although we we only need note of and note on:
http://harmony-central.com/MIDI/Doc/table1.html
and all the notes:
http://harmony-central.com/MIDI/Doc/table2.html
http://www.wavosaur.com/download/midi-note-hex.php

The one thing I still don't understand is:
Why is the code referring to middle c as 36(0x24), though midi uses 60(0x3c) as middle c?

Next Friday we will debug the hardware, by controlling the correct pinning.
And the led in stead of arduino rx pin.
If that all works, the software should be piece of cake, considering that I now understand it all, thanks to you!

Titus

actually I edited the code a bit with nice comments, so every one would be able to understand the code!

Code:
/* Midi In Basic  0.2 // kuki 8.2007
 *
 * -----------------
 * listen for midi serial data, and light leds for individual notes

 IMPORTANT:
 your arduino might not start if it receives data directly after a reset, because the bootloader thinks you want to uplad a new progam.
 you might need to unplug the midi-hardware until the board is running your program. that is when that statusLed turns on.

#####################################################################################################################################################
SOMETHING ABOUT MIDI MESSAGES
 midi messages start with one status byte followed by 1 _or_ 2 data bytes, depending on the command

 example midi message: 144-36-100
   the status byte "144" tells us what to do. "144" means "note on".
   in this case the second bytes tells us which note to play (36=middle C)
   the third byte is the velocity for that note (that is how powerful the note was struck= 100)
  
 example midi message: 128-36
   this message is a "note off" message (status byte = 128). it is followed by the note (data byte = 36)
   since "note off" messages don't need a velocity value (it's just OFF) there will be no third byte in this case
   NOTE: some midi keyboards will never send a "note off" message, but rather a "note on with zero velocity"
  
 do a web search for midi messages to learn more about aftertouch, poly-pressure, midi time code, midi clock and more interesting things.
#####################################################################################################################################################

HARDWARE NOTE:
The Midi Socket is connected to arduino RX through an opto-isolator to invert the midi signal and seperate the circuits of individual instruments.
connect 8 leds to pin2-pin9 on your arduino.

####################################################################################################################################################


 */

//variables setup

byte incomingByte;
byte note;
byte velocity;


int statusLed = 13;   // select the pin for the LED

int action=2; //0 =note off ; 1=note on ; 2= nada


//setup: declaring iputs and outputs and begin serial
void setup() {
  pinMode(statusLed,OUTPUT);   // declare the LED's pin as output
  pinMode(2,OUTPUT);
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(6,OUTPUT);
  pinMode(7,OUTPUT);
  pinMode(8,OUTPUT);
  pinMode(9,OUTPUT);
  
  //start serial with midi baudrate 31250 or 38400 for debugging
  Serial.begin(31250);        
  digitalWrite(statusLed,HIGH);  
}



void loop ()
{
  if (Serial.available() > 0)
  {
    // read the incoming byte:
    incomingByte = Serial.read();

    //edit the 144, note ON, and 128, note OFF message if you are
    //not using MIDI channel 0!!!!!!!!!!!!!!!!!!

    if (incomingByte== 144)
    { // note on message starting starting
      action=1;
    }
    else if (incomingByte== 128)
    { // note off message starting
      action=0;
    }
    else if ( (action==0)&&(note==0) )
    { //note off
      //receive note
      note=incomingByte;
      //play note(OFF)
      playNote(note, 0);
      //reset note+velocity+action
      note=0;
      velocity=0;
      action=2;
    }
    else if ( (action==1)&&(note==0) )
    { // note on
      //receive note
      note=incomingByte;
      //we end here to wait for the velocity
    }
    else if ( (action==1)&&(note!=0) )
    { // note on
      //receive velocity
      velocity=incomingByte;
      //play note(ON, or OFF if velocity==0
      playNote(note, velocity);
      //reset note+velocity+action
      note=0;
      velocity=0;
      action=0;
    }
    else
    {
      //no ON or OFF received. waiting for something to happen
    }
  }
}

void Blink()
{
  //test routine
  digitalWrite(statusLed, HIGH);
  delay(1000);
  digitalWrite(statusLed, LOW);
  delay(1000);
}


void playNote(byte note, byte velocity)
{
  //in case the keyboard doesn't use "turn note OFF" commands,
  //but rather sends a "note ON, with 0 velocity" command
  //this check does figures that out
  
  int value;
  if (velocity >10)
  {
    value=HIGH;
  }
  else{
    value=LOW;
  }

  //Although this piece of code is still strange in my opinion
  //regarding that notes form 36 to 44 aren't isn't the octave
  //of the middle c
  
  //this code shifts the notes to the correct pins
  //you can empliment more code here to turn on more
  //led(led driver/multiplexing/charlieplexing/etc...
  if(note>=36 && note<44)
  {
    byte myPin=note-34; // to get a pinnumber between 2 and 9
    digitalWrite(myPin, value);
  }

}



11  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 19, 2009, 08:13:33 am
Hi all,

I had a few questions.
I'm using some software to send midi data from the pc to a midi kabel.
I'm still confused about the pin's. I don't know if i'm mixing them up.
"putting an LED between pins 4 and 5 of the jack"
seems a good way to figure out which pin is four and which is 5.
what way would the current flow?

Should the led light up like this:
4 Cathode,
5 Anode

or like this:
4 Anode,
5 Cathode??


And what about channels? will this work with all channels? or: How to set channels?

I hope you can help me!

Titus

12  Forum 2005-2010 (read only) / Interfacing / Re: PIR, Compass HM55B, Memsic 2125 Accelerometer, on: September 16, 2007, 08:15:47 am
That's great,

would it be compatible with the wiring board?

Titus
Pages: [1]