Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redid the How-To. #30

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Redid the How-To. #30

wants to merge 11 commits into from

Conversation

baldusi
Copy link
Contributor

@baldusi baldusi commented Mar 31, 2023

Redid the How-To taking your comments, and also deleted the reference to the fire sound from the soundfont definition.

---

# Introduction
If you want to setup a blaster, first you have to understand the general mechanics of the `blaster.h` prop. A blaster is always on (unless a dedicated Power button is added). The `blaster.h` prop offers three "modes": Stunt, Kill and Auto. Also, you have a certain number of shots until you need to reload. And you have a certain chance of your weapon randombly jamming.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still says "unless a dedicated power button is added" which is somewhat misleading. It's the "poweron*.wav" that controls if there is an on/off function or not.

Please note that button behaviour differs from the saber props. As such you can have Fire (required), Mode (required), Power, Reload, Clip and/or Range. Most are of momentary type, except Clip that can be latching. Both for momentary and latching switches when it is closed a clip is assumed to be in, while open is assumed as a Clip not present.
Speaker is handled exactly the same as in the saber version, and so are the blades. The main difference is that in your hardware installation you will probably use fixed illumination elements rather than removable ones.
For exposition purposes we will assume that you will be using a Proffie V2.2 board. Also, you will have two buttons, a WS2812B strip on the weapon barrel, powered by LED 2 (pin 19), plus a Red LED for an accent powered by LED 4 (pin 5). You will connect your Fire button (trigger) to Button1 (pin 21) and your Mode button (selector) to Button2 (pin 23). Optionally, you can connect a Power button, a Reload or a Clip switch (pin 22, TX, blade3Pin, or other), and of course an OLED.
If you are not installing a Power button, be advise that you need to have a `poweron01.wav` file in your soundfont or the blaster will default to starting turned off and you will have no method to turn it on.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is backwards.
If you have a poweron*.wav, then you need a power button.
If you don't have a poweron*.wav, then it's always on, and a power button is not generally needed.

*If no `mdkill`, `mdstun`, `mdauto` nor `mode` are present Talkie voice speaks selected mode.*

# OLED Animations
[TODO]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this section for now.


/****** CONFIG_PROP blaster defines ****/
#ifdef CONFIG_PROP

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra empty line

#ifdef CONFIG_PROP

#include "../props/blaster.h"

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra empty line


#endif

/****** CONFIG_PROP blaster defines ****/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant.
The #ifdef CONFIG_PROP already declares this to be the CONFIG_PROP section.

//#define ENABLE_SSD1306 //To enable stock 128x32 monochrome SSD1306 OLED
//#define INCLUDE_SSD1306 //To enable a different aspect ratio, needs some further configuration.

//Blaster specific.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after //

Button FireButton(BUTTON_FIRE, powerButtonPin, "fire");
Button ModeButton(BUTTON_MODE_SELECT, auxPin, "modeselect");
//Button PowerButton(BUTTON_POWER, aux2Pin, "power"); //A third button to power on/off your weapon
//Button ClipButton(BUTTON_CLIP_DETECT, blade4Pin, "clip"); //Actually clip sensor. It should be closed when the clip is in, and open when the clip is removed. So you can use either latching as single button or momentary if it is a physical clip inserted sensor.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be a "Button", insted it should be a "LatchingButton" I think.


#endif

/*** OS 7+
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use
#if 0
somecode
#endif

to comment out multi-line blocks of code (instead of /* .... */)

#endif

/*** OS 7+
#ifdef CONFIG_STYLES
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave this example as basic as possible, so let's not have a CONFIG_STYLES section.,

This section is currently trivial as `blaster.h` is the only currently available prop for blaster use.

## CONFIG_PRESETS Section
Here we have really two different sets of definitions: your `Preset` which define your soundfont and styles used, and the `BladeConfig` which define your hardware.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems kind of silly to tell people what the CONFIG_PRESETS section does. We have an entire page about that already. I think this should focus on the specifics for blasters, not general explanations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants