Go Down

Topic: Analog VU Meter - I2C OLED SH1106 - OLEDMeter Animation (Read 20183 times) previous topic - next topic

stievenart

#30
Mar 06, 2017, 03:12 am Last Edit: Mar 06, 2017, 03:18 am by stievenart
Hi,

Tried a few different SMeter images but all seem to get garbled up on my tiny .96 Oled display. Any ideas or pointers greatly apreciated ;-) Maybe its the 4bit depth ?

Actually getting the same result if I load our original bmp file into Image2GLCD and paste the generated hexcode into the const...?

Never mind ;-) in the Image2GLCD tool just don't forget to set the custom size of your display and all is well.

thanks,
Leo
Hello mrbamix,

I am glad you got it worked out...

I drew the original bitmap in MSPaint... pixel by pixel. I just couldn't find any good images and the existing VU codes were too simple. That original bitmap is 128x64 and might need to be redrawn at different sizes so it scales properly.

~stievenart


lordhex

This is a phenomenal project! I've done it with an Arduino Nano and it work beautifully. Thank you stievenart for the code.

Would it be possible to drive two OLEDs with the same Arduino or I have to use a second one, with a second OLED attached to it. Wouldn't be a problem these boards are so cheap, $2 for the Arduino and $2.50 for the OLED all from Aliexpress.

You're the best!!!

stievenart

#33
May 07, 2017, 04:17 am Last Edit: May 07, 2017, 04:22 am by stievenart
Thanks for the nice words LordHex. I have been thinking about a two display version and have been looking at this post on Multiple OLEDs http://forum.arduino.cc/index.php?topic=248663.0.

The other post is written with the U8glib libraries and would involve a lot of editing to the original code to get it all to work. I think it is possible... I just haven't put it all together. I have also been looking at using a TCA9548A multiplexer to run two I2C OLEDs.

BTW... it would be nice to have right and left channels.

Robotjam

     Hello stievenart, Thank you for posting this amazing little VU meter project. I was just sitting here bored and decided to google "oled projects" and this was on the first line of images so I clicked it. Less than five minutes later I am sitting here staring at this beautiful little VU meter on a 0.96in oled. Just a few moments later I bought ten of those "TRRS" modules and I am going to put these things everywhere I have a devise that has sound.

     I see you only have hooked up the sleeve and tip inputs what happens when you try to hook up one or both of the ring inputs? Would that work for a left and right channel output? Right now I have this running on an Arduino Uno but will change it to a Nano with the bigger display when I receive my TSSR modules.

     On a slightly interesting side note when I move my finger close to the Uno the needle begins moving up higher and higher the closer my finger gets. I had a clock do that to me a long time ago, it would actually switch screens when I moved my hand close to the Uno it was running on, the author of the code could not explain it when I sent him a video and to this day I can not repeat it.

Robotjam

Hello again stievenart,

    I came across an interesting mistake while I was attempting to change the "VU" on this meter to either Left or Right. I was using the Image2GLCD software you recommended and I did not click the "invert" checkbox and the image came out with the colors inverted like the below picture. The only part of the sketch I was forced to change was the second to the last line of the code where you tell it what color to make the needle from white to black.

   I do however have one question, the needle is a little hard to see, is there a way to make the needle just a slight bit thicker? maybe just one pixel thicker.

    Once again thank you for this great VU Meter I have plans on putting these things everywhere, my wife even asked if I could mount a set in her car

stievenart

#36
Jun 14, 2017, 08:08 pm Last Edit: Jun 23, 2017, 07:34 pm by stievenart
Hello again stievenart,

   I do however have one question, the needle is a little hard to see, is there a way to make the needle just a slight bit thicker? maybe just one pixel thicker.
Hello Robotjam,

You can draw another needle next to the other needle. The needle is just a line drawn from a point off screen and trig'ed to other end. You would just have to draw them side-by-side.

  display.drawLine(a1, a2, hMeter, vMeter, WHITE);
  display.drawLine(b1, b2, hMeter + 1, vMeter, WHITE);

BTW, I wouldn't call making the background white a "mistake" that exactly one way to do exactly that... :D

Also, I am working on a 2-channel version that move the address on the rear of one OLED. I am not finished debugging it. It will end up on another thread like this one... when I'm done.
 

Robotjam

Hello stievenart, thank you for your suggestion on how to widen the needle. I copied and pasted it into my copy of the code and it didn't work but when I copied and pasted these two lines, line #153 int a1 = (hMeter + (sin(MeterValue / 57.296) * rMeter)); and line #154 int a2 = (vMeter - (cos(MeterValue / 57.296) * rMeter)); and replaced the a's with b's it worked perfectly I got the width I needed, (bad eyesight).

As for the mistake comment I just meant that I didn't know what I was doing at the time, working with a new program, even a simple but powerful and highly useful one like that.

I had grown quite impatient waiting for the TSSR modules to arrive from Japan so I hooked up a small electret microphone to my little meter, (I know its not the correct mic but its all I had laying around and like I said, impatient). I have ordered the right mic but 6 weeks for delivery and I only have 5 more weeks to wait, cant wait.

I am truly looking forward to your 2-channel version but till then I discovered a different way to achieve a 2 channel "look". I have two 0.96 oled's attached to two separate Arduino's running the exact same sketch and sharing the input from one microphone. The effect gives the illusion of a two channel meter since there is a little variation between the response of the two meters, they are not identical like I thought they would be.

I can hardly wait for your 2-channel version because lets face it "actual" two channel meters are truly much better than a simulated 2-channel version.

Again, Thank you

Yakelkun

Hello,

Great thanks for sharing and helping on this great project.

I urge to see your x2 display stereo version of this project.

Please do update this thread with the link to the new project when ready.

Once again thanks

Go Up