Hi-
I'm working on my first Arduino project (total noob) and looking for some input. Essentially I want to specify a BPM (derived in ms), then have the Arduino send out a +5v trigger signal for the 101 to lock to. Here's the very basic start I have:
/*
SH-101 Ext Clock In
reference for translating BPM to MS
http://www.futureproducers.com/forums/production-techniques/getting-started/bpm-millisecond-conversion-chart-224476/
Whole: (60.0 / bpm * 4000,1)
Half: (60.0 / bpm * 2000,1)
Quarter: (60.0 / bpm * 1000,1)
Eighth: (60.0 / bpm * 500,1)
Sixteenth: (60.0 / bpm * 250,1)
BPM: 120
Whole: 2000.0 Half: 1000.0
Quarter: 500.0 Eighth: 250.0
Sixteenth: 125.0
This example code is in the public domain.
*/
int analogPin = 3; // output to go to keyboard
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
// initial pulse
digitalWrite(13, HIGH); // set the LED on
analogWrite(analogPin, 255); // turn on signal to full strength
delay(250);
// recovery
digitalWrite(13, LOW); // set the LED off
analogWrite(analogPin, 0); // turn on signal off
delay(250);
}
After hooking up to my DMM and getting no voltage on the output, I think I've gathered I need to make a DAC to convert the voltage to something usable from analogWrite().
http://provideyourown.com/2011/analogwrite-convert-pwm-to-voltage/
I think I may be missing something on the timing - am I thinking about this right adding a delay, or is the actual timing going to be controlled with the Modulation Frequency? I also got a bit lost trying to figure out what values to plug into the online calculator at (Sample)RC Low-pass Filter Design for PWM - Result -
Lastly - given the seemingly more complex nature of the stuff I see you guys doing, is there something out there already that does this? It seems pretty low rent. Any advice would be great - I'm slowly learning!
Thanks!