PaulRB:
Your stripboard seems bigger, in terms of strips x holes?
Don't forget that fritzing will let you cut a strip between holes. In practice that's very difficult. So when you cut a track in fritzing, do it on both sides of a hole.
Yes. I found it harder to fit the pieces the way I wanted in Fritzing, so I basically just wanted to get the circuit right.
So I made the board bigger.
Does the circuit seem correct to you in general now?
Well, I get the feeling we are reasonably happy with the schematic. If Fritzing is happy that that the schematic and the stripboard layouts match, that's a pretty good sign. Now you need to squeeze it down, which may not be easy because Fritzing does not show a perfect "bird's eye view" like your other stripboard app does. But that other app could not cross-check the layout against a schematic, i'm guessing? No single app is perfect.
Just wanted to drop in here and thank Paul and Paul for all your help and thoughts.
A while ago I finished my little build and it works brilliantly.
The only issue I've got left is how I solved the off-board wiring. I used male and female break away headers for the convenience while testing, but now I guess they could possibly fall out if I shake the enclosure.
One thought is to glue the headers together with hot glue (to not have to solder anything more), but that could be bad I guess.
Maybe it's just better if I remove the female headers and solder the male headers (attached to the wires) to the board?
Bumping my own thread here.
Seems like I've got issues with the code here.
When I send 5 MIDI notes at the same time - the only LED blinking is from D3. When I use them one at a time they all work separately.
If someone's got a few minutes over I'd love some assistance.
I'd love for each of the five ports to get the LEDs to blink both on separate notes and when I send 5 MIDI notes at the same time.
Unfortunately the code I've got in my Nano right now is on another computer, so I don't have it - but it's something like this (however - I can't even compile this):
Well, no point spending too much time reading code that isn't the actual running code.... but... i can see a likely source of problems in what you have posted: "delay(100);"
Before you post the actual code, please make sure to do Tools-->Auto Format before you post it. Harder to spot errors in incorrectly formatted/indented code.
/Documents/Arduino/sketch_apr20e/sketch_apr20e.ino: In function 'void loop()':
sketch_apr20e:38: error: expected 'while' at end of input
}
^
sketch_apr20e:38: error: expected '(' at end of input
sketch_apr20e:38: error: expected primary-expression at end of input
sketch_apr20e:38: error: expected ')' at end of input
sketch_apr20e:38: error: expected ';' at end of input
sketch_apr20e:38: error: expected '}' at end of input
exit status 1
expected 'while' at end of input
It should do that, i think (i am no midi expert). If the "note off" for the first note arrives before the "note on" for the second note, then you will only get one channel on at a time. Is that what your midi keyboard is sending?
Yeah, I should have been more clear - it works to put one MIDI note at a time at the moment - but I want to benable to have all five LEDs to light up at the same time as well when I want to.
I've seen video clips of people doing this, so I guess it's not impossible - I just need to have the right code.
The line "digitalWrite(noteByte - 57, LOW);" needs a bit of work
it relies on an exact range of notes to be played
If you play a note lower than 58 you would be trying to access pin 0
So really you would need to put a range filter in place so that it only works with the notes you want it to
if (noteByte > 56 && noteByte < 61) { // <--use whatever range you need here
if (commandByte == NoteOn) {
digitalWrite(noteByte - 57, HIGH);
}
if (commandByte == NoteOff) {
digitalWrite(noteByte - 57, LOW);
}
}
it works to put one MIDI note at a time at the moment - but I want to benable to have all five LEDs to light up at the same time as well when I want to.
It will if you send the MIDI to do it. Are you playing a keyboard? If so press the notes down on at a time and hold them until all 5 notes are pressed. You will see all LEDs come on at once. As you remove your fingers from the keyboard one at a time they will go off.
Some keyboards and systems do not send a note off message, but send a note on but with a velocity of zero. The code as it stands can not deal with that.
If you want the LEDs to be on for a fixed amount of time irrespective of when a note off message is received you will have to do it a different way. You implement a state machine where the not on sets a time for the LED to be on. At the start of the loop function you check if any LED needs turning off, and turn it off if needed.