Blaster oled doesnt display bmps

I have the oled connected to my test bed and it is working. when booting it shows the proffie logo, then goes to what I assume is a battery indicator.

However I can not get it to show anything other than “on.bmp”. All the bmp’s should be formatted correctly as far as I can tell.

here is the serial monitor for effects:

Found blast.bmp files: one unnumbered file in subdirs in E-11
Found idle.bmp files: one unnumbered file in E-11
Found unjam.wav files: one unnumbered file in E-11
Found stun.wav files: 1-1 in subdirs in E-11
Found reload.wav files: one unnumbered file in E-11
Found range.wav files: 1-6 in E-11
Found plion.wav files: one unnumbered file in E-11
Found plioff.wav files: one unnumbered file in E-11
Found mode.wav files: 1-4 in subdirs in E-11
Found jam.wav files: one unnumbered file in E-11
Found full.wav files: one unnumbered file in E-11
Found empty.wav files: one unnumbered file in E-11
Found clipout.wav files: one unnumbered file in E-11
Found clipin.wav files: one unnumbered file in E-11
Found blast.wav files: 1-11 in subdirs in E-11
Found endauto.wav files: 1-11 in subdirs in E-11
Found auto.wav files: 1-11 in subdirs in E-11
Found font.wav files: one unnumbered file in E-11
Found boot.wav files: 1-1 in subdirs in E-11
Done listing effects.

Nothing is displayed when blast.wav is played, nothing plays when “idle” (but if I had “on.bmp” there, it plays constantly).

Does it say anything in the serial monitor when one of these files is supposed to play?

It does not with those 2 effects bmps.

If I add “on.bmp” it plays on the screen and the serial monitor does say Playing E-11/on.bmp

What prop are you using?
Maybe just post your config file?

… and what version of ProffieOS ?

I am using the included “blaster.h” prop. Here is the config:

#ifdef CONFIG_TOP
#include "proffieboard_v3_config.h"
#define NUM_BLADES 2
#define NUM_BUTTONS 2
#define VOLUME 1000
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
//#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define INCLUDE_SSD1306 //64x32
#define OLED_USE_BLASTER_IMAGES
//#define SAVE_STATE
//#define DISABLE_DIAGNOSTIC_COMMANDS
#define DISABLE_BASIC_PARSER_STYLES
#define NO_REPEAT_RANDOM
#define DELAYED_OFF
#define ENABLE_BLASTER_AUTO
//#define BLASTER_SHOTS_UNTIL_EMPTY 15  // (whatever number)
//#define BLASTER_JAM_PERCENTAGE 5     // if not defined, random.
//#define BLASTER_DEFAULT_MODE MODE_KILL
//#define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
#endif

#ifdef CONFIG_PROP
#include "../props/blaster.h"
#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {

{ "E-11", "tracks/E11.wav",
// muzzle
  StylePtr<Layers<
    Black,
    TransitionEffectL<TrConcat<TrDelay<100>,White,TrFade<200>,Rgb<180,0,0>,TrFade<300>>,EFFECT_FIRE>,
    TransitionEffectL<TrConcat<TrDelay<100>,DeepSkyBlue,TrFade<200>,Blinking<Black,Blue,100,500>,TrFade<300>>,EFFECT_STUN>,
    LockupTrL<Layers<
      TransitionLoopL<TrConcat<TrInstant,White,TrFade<50>,Red,TrFade<150>>>>,TrInstant,TrConcat<TrInstant,Rgb<50,0,0>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),

// barrel
  StylePtr<Layers<
    Black,
    TransitionEffectL<TrConcat<TrWipeIn<100>,White,TrWipeIn<100>,Red,TrWipeIn<200>>,EFFECT_FIRE>,
    TransitionEffectL<TrConcat<TrWipeIn<100>,DeepSkyBlue,TrWipeIn<100>,Blinking<Black,Blue,100,500>,TrWipeIn<200>>,EFFECT_STUN>,
    LockupTrL<Layers<
      TransitionLoopL<TrConcat<TrWipe<50>,Red,TrWipe<100>>>,
      TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<32768>,Int<25000>>>,TrFade<150>>>,
      TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<32768>,Int<25000>>>,TrFade<150>>>>,TrConcat<TrInstant,Rgb<255,100,100>,TrFade<150>>,TrJoin<TrConcat<TrInstant,AlphaL<Rgb<50,0,0>,Bump<Int<32768>,Int<60000>>>,TrFade<400>>,TrConcat<TrDelay<416>,Black,TrWipeInSparkTip<White,150,150>>,TrWaveX<Rgb<50,0,0>,Int<1800>,Int<40>,Int<400>,Int<27500>>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
"E-11"},

};

BladeConfig blades[] = {
{ 0, 
	SubBlade(9, 9, WS281XBladePtr<10, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >()), /* muzzle */
	SubBlade(0, 8, NULL), /* barrel */
CONFIGARRAY(presets) },
};
#endif

#ifdef CONFIG_BUTTONS
Button FireButton(BUTTON_FIRE, powerButtonPin, "fire");
Button ModeButton(BUTTON_MODE_SELECT, auxPin, "modeselect");
#endif

#ifdef CONFIG_BOTTOM
BlasterDisplayController<64, uint32_t> display_controller;
SSD1306Template<64, uint32_t> display(&display_controller);
#endif

Not sure what version of proffieos I have, but it looks like I downloaded it from the master on sep 25. Typing version in the serial monitor spits out a long id code.

Do you have “mass storage” on?
There is some code that tries to avoid playing idle.wav when USB is connected. if mass storage is on. I recommend adding the MOUNT_SD_SETTING define, as that will keep your SD card safe from corruption, while still letting you have access to it by using the “sd 1” command in the serial monitor. Also, idle.bmp will play when USB is connected and only stop when you issue the “sd 1” command.

Of course, none of the files can play when the sd card is mounted on the computer, but then you would see “sd card busy” or something like that in the serial monitor, so I guess that’s not really the problem here…

These defines don’t do anything.

It seems like it should work though…
Can you send me a PM with the files you are using.
If you can’t get this working, I’m going to try it on my board and see if I can figure it out.
Not sure if I have a 64x32 display though, I’ll have to check. Do you have a link to the display you are using?

Yes, it was. I added the MOUNT_SD_SETTING define and no change to the display. I ended up turning it off and removing the define.

Not sure where I got the oled image one, but it was from the forum. I will removed these.

Yes, here it is https://www.aliexpress.us/item/3256808901049556.html

I found a bug, please download the latest from github master and try again.

Great! It now works like I thought it would!

I loaded a “on.bmp” and it plays steadily. I placed a “blast1.bmp” in the blast directory and it shows for about a second then goes back to “on”. Is there a way to adjust how long it is displayed?

Also - I place a “stun1.bmp” with the stun wav files, however it does not show when triggering stun. I see it is not mentioned on the pod page ProffieOS Documentation: OLED images and animations

Also, from Proffie 8.x, you can use the BlasterDisplayController to activate these extra events:

    blast
    reload
    empty
    jam
    clipin
    clipout
    destruct

I assume this will also be true for the auto wavs. Is there a way to have the blast.bmp show for each of these events?

Either way, thank you for the fix!

Yes, you can use ProffieOSFireImageDuration in the font.ini specify this.
(Please let me know if there are any problems with it since it’s not very well tested obviously…)

Stun is not yet supported, it it could be fairly easily added here:

Just adding case EFFECT_STUN: before case EFFECT_FIRE: will make them do the same thing.

Auto can also be added, but it would be a bit different since auto is a lockup mode. You would want a looped animation and some code that starts/stops it.

I can test this, but is there documentation? I looked around and didn’t see it for certain.

There doesn’t seem to be any.

You can find this, and related values in the source here though:

I made a blaster.h where stun.bmp is supported in all the relevant spots:
blaster_mod_oli.h (20.7 KB)

1 Like

Maybe submit a pull request?

Thanks! I was just working on that myself, but missed a few lines. I will test tomorrow and let you know how it works.

I had started modifying that in my github, I planned on submitting a pull request once tested.

Apologies @profezzorn,I didn’t think you’d want another PR since there are already 8 open PR (and 4 of them that you didn’t reply or comment on yet). I figured you were too busy with other projects ?

I just wanted to help @orntar.

I will let you @orntar do the PR since you already started (just remove the “// added by Oli” comments if you plan to use my blaster_mod_oli.h file.

I was thinking of adding Auto as well but I don’t know how to do:

Same, lol.

1 Like

Please don’t worry about that.
In fact, more PRs will motivate me to work more on all the PRs.

Basically you have to update the code that plays the “default” image to consider the current lockup mode. I think there is already code that re-checks the default when lockup begins end, so hopefully that should be it…

So the prop (blaster.h) will trigger SaberBase::SetLockup(LOCKUP_AUTOFIRE);, SaberBase will keep doing LOCKUP_AUTOFIRE as long as the lockup condition is met.

In order to play an auto.bmp is it enough to have in the case switch:

code deleted due to incorrect and not working

and add:

#define ONCE_PER_BLASTER_EFFECT(X)    \
  X(auto)                             \
  X(stun)                             \
  X(blast)                            \
...

code deleted due to incorrect and not working

And for color OLED we add:

code deleted due to incorrect and not working

And when LOCKUP_AUTOFIRE stops, then the auto.bmp animation stops as well ?

No AI was used in the writing of the code above! I just looked at the code in saber_base.h and hybrid_font.h responsible for playing &SFX_auto and tried to apply the same logic to &img_.IMG_auto

Am I on the right track or is this code wishful-thinking ?

Edit: I didn’t tried the code above because I do not have a working OLED yet.

Edit2: I deleted the incorrect code above.

1 Like