سلام به همه،
من مدتی است که روی یک کنترلر midi کار می کنم، Midi OUT مشکلی نداشته است، اما برای Midi IN باید کمی زمان بیشتری می گرفتم.
من از این مدار برای ورودی midi استفاده کرده ام اما از 4n25 استفاده کرده ام:
موضوع اصلی @ http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1187962258/
عالی کار می کند!
اما برای پروژهام به VU متر نیاز دارم، فکر میکردم این مشکلی نخواهد داشت، زیرا میتوانم به راحتی به آردوینو خود بگویم: اگر note = 1 و سرعت = 80 باشد، LED A،B و C را روشن کنید.
اما من نتوانستم این کار را انجام دهم. در حالی که این به راحتی می تواند یک مشکل کدگذاری باشد، من نمی خواستم 10 پین در هر VU متر را هدر دهم، بنابراین بیشتر جستجو کردم و یک LM3914 پیدا کردم.
با خودم فکر کردم که به راحتی می توانم این کار را از طریق یک پین PWM انجام دهم، بنابراین با این کار حدود 36 پین صرفه جویی می کنم. در کل من به 4 (مونو) VU متر نیاز دارم، بنابراین باید از 4 پین pwm استفاده کنم.
بنابراین من LM3914 را خریدم و سپس مشکلات دیگری ظاهر شد. خوشبختانه من این انجمن را پیدا کردم!
به خصوص پاسخ های گروهبان Wookie در LM3914، بسیار مفید بودند.
بنابراین من این شماتیک را ساختم
و اکنون یک مدار RC بین آردوینو و LM3914 ایجاد کردم. با یک مقاومت 4 کوهم و درپوش 1uF.
همچنین به نظر می رسد که خوب کار می کند، به عنوان مثال من می توانم مقدار 80 را از پین pwm خروجی بگیرم و این همه LED ها را روشن می کند، یا می توانم مقدار 41 را خروجی کنم و این 5 LED را روشن می کند.
من همچنین سعی کردم مدار را به خط خارج از کامپیوترم وصل کنم، همانطور که انتظار می رود LED ها با db واقعی مطابقت ندارند، اما همزمان با VU متر میکسر من روشن می شود، بنابراین می دانم که به اندازه کافی سریع است. برای حفظ کردن.
و مشکل اینجاست، وقتی این مدار به پین PWM آردوینو وصل میشود، همیشه یک ضرب عقب است، به نظر یک فیلم استاپ موشن بد است... بنابراین حدس میزنم
مشکل میتواند در کدنویسی باشد، اما به همان اندازه خوب است. در مدار
امیدوارم این اطلاعات کافی باشد و من واقعاً امیدوارم که هر کسی در اینجا بتواند به من کمک کند، من بیش از سه هفته است که سعی کرده ام این کار را انجام دهم ... در انجمن های مختلف پرسیده شده است، اما تاکنون پاسخی پیدا نکرده ام.
این شماتیک و کدی است که اکنون استفاده می کنم:
btw من در حال خواندن کانال خروجی اصلی سمت چپ، از طریق midi با یک نت، با محدوده سرعت بین 0 تا 127 هستم.
برای جزئیات بیشتر: Midi VU meter، LM3914، Arduino، PWM
در ادامه، متن انگلیسی این مطلب را میتوانید مشاهده نمایید:
Hello everybody,
I’ve been working on a midi controller for some time now, Midi OUT hasn’t been a problem, but for Midi IN i had to take some more time.
i’ve used this circuit for midi input but i’ve used a 4n25:
original thread @ http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1187962258/
it works great!
but for my project i need VU meters, i thought this wouldn’t be a problem, because i could easily say to my arduino: if note = 1 and velocity = 80 then turn on LED A,B and C.
But i could’nt get this to work. while this easily could be a coding problem, i didn’t want to waste 10 pins per VU meter, so i searched some more and found a LM3914.
i thought to myself i could easily make this work through a single PWM pin, so this would save me about 36 pins. in total i need 4 (mono) VU meters, so i would have to use 4 pwm pins.
so i bought the LM3914 and then other problems turned up. luckily i found this forum!
especialy Sgt Wookie answers on the LM3914, were very helpfull.
so i constructed this schematic
now i made a RC-circuit in between the Arduino and the LM3914. with a 4Kohm resistor and 1uF cap.
also this seems to work fine, for example i can output a value of 80 from the pwm pin and this will light up all leds, or i can output a value of 41 and this will light up 5 leds.
i also tried connecting the circuit to the line out of my computer, as expected the leds do not correspond with the actual db’s, but it light’s up at the same time as the VU meter of my mixer does, so i know it is fast enough to keep up.
and here is the problem, when this circuit is connected to the PWM pin of the arduino, it’s always one beat behind, it kinda looks like a bad stop motion movie…
so i guess the problem could be in the coding, but just as good in the circuit.
hope this is enough information and i really hope anybody here can help me out, i’ve been trying to make this work for over three weeks now…asked at different forums, but haven’t found an answer so far.
here is the schematic and code i use now:
btw i’m reading the left master output channel, through midi with a single note, with a velocity range between 0 and 127.
For more dtail: Midi VU meter, LM3914, Arduino, PWM