You are correct, we could both easily add a loop to write up bunch of 0's... I just want newer users to understand you can use any image and "cut and paste" it into any .ino file. Besides, the code works great with them in it... you should try it.
OLED Meter not working,please complete source-code,hank you Stievenart,
The code is complete... you need to load the libraries to make this work. This is not a beginner animation and you should try some basic Arduino codes first. Arduino is a learning tool and I am not going to hold your hand.
~Stievenart
I HAVE ATTACHED THE WHOLE CODE A SECOND TIME BELOW!
was searching the net for addtl info on VU meter with Oleds, when I stumbled upon your project. saved me LOTS of time coding
done mine though with SSD1306, some minor changes on code, and viola!. will definitely "try" another VU image background
sorry for the dark image, did NOT want to use flash on phone, else I get incomplete LCD info. I hope attached image comes out right!
now on to some more tweaking! plan on adding this to an existing arduino VU meter (WS2812B) project, if addtl memory permits
Ive done the said hardware with an Arduino nano clone, a 128x64 Oled (clone?) of ebay. careful with this one, some Oled displays have "NO ACKNOWLEDGE". ask me how I know but there are some fixxes to that.
define a single Digital pin as output, and use that PIN to power the display. problem fixxed! although u8glib has this done already.
VERY NICE RALPH! I was hoping someone would confirm the code. I have gotten a lot of traffic on this project. Thanks for posting a picture the OLEDMeter in action.
BTW, feel free to post your .ino with the u8glib version. I haven't tried u8glib yet and I am sure someone might need help with it...
I have changed the 'VU' to read "S units" and the display will be used as an S meter on the front panel of my BITX40 transceiver.
I have another identical display as the operating frequency and step rate display for a modified Adafruit si5351 oscillator.
Each display is running from its own Arduino Nano simply because they're so cheap.
Thanks again for the code (and the link to the Image3GLCD conversion software)
masterice:
Superb bit of code!
Just what I was looking for.
I have changed the 'VU' to read "S units" and the display will be used as an S meter on the front panel of my BITX40 transceiver.
I have another identical display as the operating frequency and step rate display for a modified Adafruit si5351 oscillator.
MasterIce
Thanks for the "Superb" comment... So, you are using it for signal strength on a HAM radio?
Hi Stievenart
Yes the S meter project is exactly as you say. It won't be too accurate as it's using an audio derived signal from prior to the main audio amplifier but it's more to make the front panel of the final rig look that bit more professional LOL
I used the Project Sketch in the Arduino IDE, however the following error appears:
C:\Program Files (x86)\Arduino\libraries\Adafruit_SH1106-master\Adafruit_SH1106.cpp: In member function 'virtual void Adafruit_SH1106::drawPixel(int16_t, int16_t, uint16_t)':
C:\Program Files (x86)\Arduino\libraries\Adafruit_SH1106-master\Adafruit_SH1106.cpp:123:14: error: 'swap' was not declared in this scope
swap(x, y);
^
C:\Program Files (x86)\Arduino\libraries\Adafruit_SH1106-master\Adafruit_SH1106.cpp: In member function 'virtual void Adafruit_SH1106::drawFastHLine(int16_t, int16_t, int16_t, uint16_t)':
C:\Program Files (x86)\Arduino\libraries\Adafruit_SH1106-master\Adafruit_SH1106.cpp:673:16: error: 'swap' was not declared in this scope
swap(x, y);
^
C:\Program Files (x86)\Arduino\libraries\Adafruit_SH1106-master\Adafruit_SH1106.cpp: In member function 'virtual void Adafruit_SH1106::drawFastVLine(int16_t, int16_t, int16_t, uint16_t)':
C:\Program Files (x86)\Arduino\libraries\Adafruit_SH1106-master\Adafruit_SH1106.cpp:741:16: error: 'swap' was not declared in this scope
ric_xcer:
Loved it. I really enjoyed the project. Thanks for sharing. I'm waiting for Oled to arrive (Aliexpress) to do it. Congratulations Stivienart.
Thanks for the congrats Ric_xcer!
Try to (re)load latest libraries with links inside sketch highlighted:
Very nice work dude! Done mine though with SSD1306, some minor changes on code, and viola! Looks very pretty, sexy!
I don't have the mic amplifier but (see some movements when I touch the analog pins) was busy with a serial VU meter with a Delphi (Windows) program that works fine with the Arduino Nano. Got digital already and now I want to modify the code to communicate with my Windows program. My Windows program communicate with percentages so I have to change that.
One thing though, the VU doesn't move that natural (too fast to my taste). There is a simple tweak, don't allow fast changes below the peak and decrease the peak with two degree above 50% and decrease below that with one degree until a new peak detected. Simple tweak and looks much more natural because of the smooth fall in value.
Did this with a flash VU meter in the past, did the same trick in my Delphi program so I don't have to change the arduino code.
Very nice job, many thanks. Maybe I post my code some day on instructables. Some work to do right now but want you to know that your work is awesome. Many thanks! Maybe I rewrite the Adafruit code to OLED_I2C because it is a much lighter library so you are able to use it with lower amount of memory.
Actually planning on doing the exact same thing An extra Arduino in my Bitx40 as well to drive the display and this oled as well. Got the .96 SPI oled going yesterday with some slight modifications and also had to use a different library to get the SPI version going. Otherwise works great Mine still uses the VU graphic though hehehe Will have to change that though.
Regards
Leo
PD1LDB
masterice:
Superb bit of code!
Just what I was looking for.
I have changed the 'VU' to read "S units" and the display will be used as an S meter on the front panel of my BITX40 transceiver.
I have another identical display as the operating frequency and step rate display for a modified Adafruit si5351 oscillator.
Each display is running from its own Arduino Nano simply because they're so cheap.
Thanks again for the code (and the link to the Image3GLCD conversion software)
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
stievenart:
Here is a link to the original bitmap (BMP file) to this post and the original bitmap:
The code for the bitmap is in the link'ed .ino file on the first post.