Skip to content

Commit

Permalink
Included option to rotate screen 180°
Browse files Browse the repository at this point in the history
For left-handed use of M32 Pocket
  • Loading branch information
oe1wkl committed Dec 7, 2024
1 parent 612f68f commit c0e0108
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 21 deletions.
8 changes: 6 additions & 2 deletions Documentation/User Manual/Version 6.x/m32_user-Manual_v6.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1045,11 +1045,11 @@ Be aware that you must have an antenna connected when you transmit via LoRa, oth

== Appendices

=== Appendix 1: Hardware Configuration (LoRa and Calibration of Battery Measurement)
=== Appendix 1: Hardware Configuration (Screen, LoRa and Calibration of Battery Measurement)

There is a hardware configuration menu that can be reached by pressing a paddle (or external paddle or straight key) while switching the M32 on. You can then select the configuration you want to perform by rotating the encoder knob, and pressing it once the right option shows up.

The selectable options are "Calibr. Batt." (calibration of battery measurement), "LoRa Config." and "Cancel" (which just leaves this menu and continues with regular start-up of the M32).
The selectable options are "Calibr. Batt." (calibration of battery measurement), "Flip Screen", "LoRa Config." and "Cancel" (which just leaves this menu and continues with regular start-up of the M32).

==== Appendix 1.1: Configuring LoRa Bands, Frequencies and Output Power [[appendix1_1]]

Expand Down Expand Up @@ -1088,6 +1088,10 @@ In order to calibrate the voltage measurement, you have to measure the actual ba
* You will see a voltage value (in Millivolts) on the display. Now rotate the encoder until the displayed value is as close as possible to the measured battery voltage.
* Press the BLACK encoder knob to store the calibration value, and to continue with the boot-up of the M32.

==== Appendix 1.3: Flipping the display screen for left-hand use [[appendix1_3]]

This is probably only relevant for the M32 Pocket!
With the M32 Pocket, if you want to key with your left hand, the normal display would be upsode down; with this configuration option the display is rotated by 180° to allow lef-thand use.

=== Appendix 2: Adjusting Audio Input Level [[app2]]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ Beachte, dass beim Senden über LoRa eine Antenne angeschlossen sein muss, da so

== Anhänge

=== Anhang 1: Hardware Konfiguration (LoRa und Kalibrierung der Batterie-Messung)
=== Anhang 1: Hardware Konfiguration (Anzeige, LoRa und Kalibrierung der Batterie-Messung)

Es gibt ein Hardware-Konfigurationsmenü, welches man erreicht, indem man das Paddle (oder ein externes Paddle bzw. eine Handtaste) beim Einschalten des Morserino-32 gedrückt hält. Man kann dann die gewünschte Konfiguration durch Drehen des Drehreglers auswählen, und mit einem Druck auf den schwarzen Knopf aktivieren.

Expand Down Expand Up @@ -1090,6 +1090,10 @@ Um die Messung der Batteriespannung zu kalibrieren, musst du zuerst einmal die S
* Man sieht nun eine Spannungsanzeige am Display (in Millivolt). Dreh nun den Drehregler in die eine oder andere Richtung, bis der angezeigte Wert möglichst nahe am gemessenen Wert der Batteriespannung liegt.
* Drück den Schwarzen Knopf um den Kalibrierungswert zu speichern, und um mit dem Hochfahren des M32 fortzufahren.

==== Anhang 1.3: Flip Screen (Drehung des Displays für linkshändige Benutzung)

Dies ist vermutlich nur für das M32 Pocket relevant!
Würde man beim M32 Pocket mit der linken Hand die Paddles betätigen, würde die Anzeige auf dem Kopf stehen; mit dieser Konfigurationsoption wird die Anzeige um 180° gedreht, um eine linkshändige Bedienung zu ermöglichen.

=== Anhang 2: Einstellen des Audioeingangspegels [[appendix2]]

Expand Down
5 changes: 5 additions & 0 deletions Software/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
10 changes: 10 additions & 0 deletions Software/src/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
3 changes: 2 additions & 1 deletion Software/src/Version 6/MorseOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ void MorseOutput::initDisplay()
digitalWrite(OLED_RST, HIGH);
#endif
display.init();
display.flipScreenVertically();
if (! MorsePreferences::leftHanded)
display.flipScreenVertically();
display.clear();
}

Expand Down
29 changes: 20 additions & 9 deletions Software/src/Version 6/MorsePreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Preferences pref; // use the Preferences library for storing and r
posQuickStart, posAutoStop, posMaxSequence, posLoraChannel, posSerialOut, // 31
// to be treated differently:
posKochFilter, // 36
posLoraBand, posLoraQRG, posSnapRecall, posSnapStore, posVAdjust, posHwConf // 37
posLoraBand, posLoraQRG, posSnapRecall, posSnapStore, posVAdjust, posHwConf, posScreen // 37
};
*/

Expand Down Expand Up @@ -331,7 +331,7 @@ String extraItems[] = {"Koch Lesson", "LoRa Band", "LoRa Frequ", "LoRa Power",
uint8_t MorsePreferences::loraBand = 0; // 0 = 433, 1 = 868, 2 = 920
uint32_t MorsePreferences::loraQRG = QRG433; // for 70 cm band
uint8_t MorsePreferences::loraPower = 14; // default 14 dBm = 25 mW

boolean MorsePreferences::leftHanded = false; // to flip screen for left-handed use in Pocket


///// stored in preferences, but not adjustable through preferences menu:
Expand All @@ -353,7 +353,6 @@ uint8_t MorsePreferences::loraPower = 14; // default 14 dBm =
uint8_t MorsePreferences::kochMaximum = 52;
String MorsePreferences::customCharSet = ""; // a place to store the custom character set
boolean MorsePreferences::useCustomChars = false; // flag if we should use custom characters
//uint8_t MorsePreferences::responsePause = 5; // in echoTrainer mode, how long do we wait for response? in interWordSpaces; 2-12, default 5

uint8_t MorsePreferences::menuPtr = 1; // current position of menu
uint8_t MorsePreferences::newMenuPtr = 1; // current position of menu when changed
Expand All @@ -371,7 +370,6 @@ uint8_t MorsePreferences::loraPower = 14; // default 14 dBm =
String MorsePreferences::wlanTRXPeer3 = ""; // peer Morserino for WiFI TRX

uint32_t MorsePreferences::fileWordPointer = 0; // remember how far we have read the file in player mode / reset when loading new file
//uint8_t MorsePreferences::promptPause = 2; // in echoTrainer mode, length of pause before we send next word; multiplied by interWordSpace
touch_value_t MorsePreferences::tLeft = 20; // threshold for left paddle
touch_value_t MorsePreferences::tRight = 20; // threshold for right paddle

Expand Down Expand Up @@ -621,7 +619,7 @@ void MorsePreferences::displayKeyerPreferencesMenu(prefPos pos) {
displayValueLine(pos, itemLine, false);
}

/// posKochFilter, posLoraBand, posLoraQRG, posSnapRecall, posSnapStore, posVAdjust, posHwConf
/// posKochFilter, posLoraBand, posLoraQRG, posSnapRecall, posSnapStore, posVAdjust, posScreen, posHwConf



Expand Down Expand Up @@ -753,11 +751,14 @@ String MorsePreferences::getValueLine(prefPos pos) {
sprintf(numBuffer, "%4d mV", volt);
str = String(numBuffer);
break;

case posHwConf:
switch (hwConf) {
case 1: str = "Calibr. Batt.";
break;
case 2: str = "LoRa Config.";
case 2: str = "Flip Screen";
break;
case 3: str = "LoRa Config.";
break;
default: str = "Cancel";
break;
Expand Down Expand Up @@ -883,8 +884,8 @@ boolean MorsePreferences::adjustKeyerPreference(prefPos pos) { /// rotati
MorsePreferences::vAdjust = constrain(MorsePreferences::vAdjust, 155, 254);
break;
case posHwConf:
hwConf += (t+3);
hwConf = hwConf % 3;
hwConf += (t+4);
hwConf = hwConf % 4;
break;
case posLoraPower:
MorsePreferences::loraPower += t; // set the LoRa band
Expand Down Expand Up @@ -1010,6 +1011,11 @@ void MorsePreferences::readPreferences(String repository) {
MorsePreferences::loraPower = temp;
else
MorsePreferences::loraPower = 14;

if (temp = pref.getBool("leftHanded"))
MorsePreferences::leftHanded = temp;
else
MorsePreferences::leftHanded = false;

MorsePreferences::snapShots = pref.getUChar("snapShots",0);
updateMemory(MorsePreferences::snapShots);
Expand Down Expand Up @@ -1073,7 +1079,6 @@ void MorsePreferences::writePreferences(String repository) {
if (morserino) { // the following things are not stored in snapshots anymore,
//only in the ""Morserino" permanent memory
pref.putUChar("brightness", MorsePreferences::oledBrightness); // if not snapshots, store current screen brightness

if (MorsePreferences::pliste[posSerialOut].value != pref.getUChar("serialOut")) {
pref.remove("serialOut");
pref.putUChar("serialOut", MorsePreferences::pliste[posSerialOut].value);
Expand Down Expand Up @@ -1363,6 +1368,12 @@ void MorsePreferences::calibrateVoltageMeasurement() {
pref.end();
}

void MorsePreferences::flipScreen() {
MorsePreferences::leftHanded = ! MorsePreferences::leftHanded;
pref.begin("morserino", false);
pref.putBool("leftHanded", MorsePreferences::leftHanded);
pref.end();
}

void MorsePreferences::fireCharSeen(boolean wpmOnly)
{
Expand Down
2 changes: 2 additions & 0 deletions Software/src/Version 6/MorsePreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ namespace MorsePreferences
#define QRG920 920.55E6
extern uint32_t loraQRG;
extern uint8_t loraPower;
extern boolean leftHanded;
extern uint8_t snapShots;
extern uint8_t boardVersion;
extern uint8_t oledBrightness;
Expand Down Expand Up @@ -182,6 +183,7 @@ namespace MorsePreferences
void setCustomChars(String);
//void kochSetup();
void loraSystemSetup();
void flipScreen();
void determineBoardVersion();
void calibrateVoltageMeasurement();
void writeWordPointer();
Expand Down
9 changes: 5 additions & 4 deletions Software/src/Version 6/m32_v6.ino
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ ESP32Encoder rotaryEncoder;
// <== left, count down


int8_t woken = 0; // what for?


///// the states the morserino can be in - selected in top level menu
morserinoMode morseState = morseKeyer;
Expand Down Expand Up @@ -155,7 +153,7 @@ GEN_TYPE generatorMode = RANDOMS; // trainer: what symbol (groups) are
File file;

/// variable for selecting a hardware configuration menu option
int8_t hwConf = 1; // 0 = cancel hw config, 1 = battery measurement calibration, 2 = lora config
int8_t hwConf = 1; // 0 = cancel hw config, 1 = battery measurement calibration, 2 = flip screen, 3 = lora config

boolean kochActive = false; // set to true when in Koch trainer mode

Expand Down Expand Up @@ -532,7 +530,10 @@ void setup()
case 1:
MorsePreferences::calibrateVoltageMeasurement();
break;
case 2: MorsePreferences::loraSystemSetup();
case 2: MorsePreferences::flipScreen();
ESP.restart();
break;
case 3: MorsePreferences::loraSystemSetup();
break;
default: break;
}
Expand Down
6 changes: 3 additions & 3 deletions Software/src/Version 6/morsedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ const String PROJECTNAME = "Morserino-32";

#define VERSION_MAJOR 6
#define VERSION_MINOR 0
#define VERSION_PATCH 0
#define VERSION_PATCH 1

#define BETA false
#define BETA true


#define IGNORE_SERIALOUT false
#define IGNORE_SERIALOUT true

// if IGNORE_SERIALOUT is true, alle DEBUG messages are on serial out, even when Serial Out is active outputting characters from Keyer, Decoder etc

Expand Down
2 changes: 1 addition & 1 deletion Software/src/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

[platformio]
src_dir=Version 6
default_envs=heltec_wifi_lora_32_V2
default_envs=heltec_wifi_kit_32_V3

[common]
lib_deps_external =
Expand Down

0 comments on commit c0e0108

Please sign in to comment.