Skip to content

Commit

Permalink
Version 5
Browse files Browse the repository at this point in the history
V.5.0 includes now a serial protocol for communication through USB.
  • Loading branch information
oe1wkl committed Jun 21, 2023
1 parent c485995 commit 425bde1
Show file tree
Hide file tree
Showing 35 changed files with 11,481 additions and 1 deletion.
421 changes: 421 additions & 0 deletions Documentation/Protocol Description/M32 Protocol.md

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Morse Code Over Packet Protocol (MOPP)

Date: June 06, 2020
Version: 1.0
Authors: Willi, OE1WKL

## Introduction

In order to send Morse code over either LoRa or over IP, both of which transmit byte strings as packet payloads, we need a protocol to represent Morse code within these byte strings. For the Morserino-32 the following protocol (calles MOPP for short) has been established (which could of course be used by other hardware or software tools).
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/User Manual/Version 5.x/M32c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Documentation/User Manual/Version 5.x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Morserino-32 User Manual
Morserino-32 multi-functional Morse code machine, based on ESP32

## User Manual in German and English.
You may submit translations into other languages. If you do so, please translate the *source code* in ASCIIDOC format - if you do so, you can focus on the translation, and the formatting will happen automagically!

(This documents are copyrighted as Creative Commons, CC BY-NC-SA 3.0 AT)
73 changes: 73 additions & 0 deletions Documentation/User Manual/Version 5.x/m32-theme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
extends: default
page:
layout: portrait
size: A4
margin: [1.5cm, 2cm, 1.5cm, 2cm]
margin-inner: 4cm
margin-outer: 2.5cm
title-page:
logo:
image: m32c.png
title:
font-size: 24
font_color: D32F2F
subtitle:
font-family: Noto Serif
font-size: 28
font-style: bold
font-color: D32F2F
base:
font-family: Helvetica
font-color: 111111
font-size: 10.5
line-height-length: 14
line-height: $base-line-height-length / $base-font-size
vertical-spacing: $base-line-height-length
heading:
font-family: Helvetica
font-size: 14
font-style: bold
line-height: 1.2
margin-bottom: $vertical-spacing
header:
font-size: 10
font_color: 777777
height: 1cm
recto:
center:
content: '_{organization}_'
verso:
center:
content: '_{organization}_'
footer:
font-size: 11
font_color: 444444
height: 1cm
recto:
right:
content: '{chapter-title} | {page-number}'
left:
content: image:m32c.png[pdfwidth=0.25in]
verso:
left:
content: '{page-number} | {chapter-title}'
right:
content: image:m32c.png[pdfwidth=0.25in]
table:
border-color: 888888
stripe-background-color: AAAAAA
toc:
font-size: 10
title:
font-family: Noto Serif
font-size: 24
dot-leader:
font-color: 888888
heading:
font-color: D32F2F
h2-font-family: Noto Serif
h2-font-size: 24
h3-font-size: 18
h4-font-size: 14
literal:
background-color: dddddd
1,139 changes: 1,139 additions & 0 deletions Documentation/User Manual/Version 5.x/m32_user-Manual_v5.adoc

Large diffs are not rendered by default.

Binary file not shown.
1,139 changes: 1,139 additions & 0 deletions Documentation/User Manual/Version 5.x/m32_user-Manual_v5_de.adoc

Large diffs are not rendered by default.

Binary file not shown.
27 changes: 26 additions & 1 deletion Software/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Build Instructions (for Arduino IDE)

It is now quite straightforward to set up an environment to build the Morserino-32 binary code from the source. As we are using now the latest ESP32 libraries from Heltec, and the source of the Clivkbutton library has been included into the source, there is no need to hint for libraries.
It is now quite straightforward to set up an environment to build the Morserino-32 binary code from the source. As we are using now the latest ESP32 libraries from Heltec, and the source of the Clivkbutton library has been included into the source, there is no need to hunt for libraries.

**NOTICE: As Heltec changed their development environment libraries to accomodate newer products, you might need to set up an environment with their older library versions!**

1. Set up the Arduino IDE from <https://www.arduino.cc/en/Main/Software>.

Expand All @@ -16,6 +18,29 @@ It is now quite straightforward to set up an environment to build the Morserino-

## Change History

### Changes V.5.0

#### Bug fixes:

* `<bk>` was not recognized as pro sign in file player. Fixed.
* `<err>` was only recognized once in echo Trainer mode, so you could only correct one error within a word. Fixed: it behaves now like a backspace key.
* Some inconsistencies in displaying snapshot functions and hardware calibration functions. Fixed.
* Paddle polarity was the opposite as shown in the preferences. Fixed.
* Touching touch paddles at power-on to get into hardware configuration menu was not very reliable. Hopefully fixed.

#### Feature Modifications / Improvements:

* `\c` or `<c>` marks the begin of a comment in a file player text file - these characters or the word containing one of these and the rest of the line are ignored.
* The order of parameters in the parameter menu has been changed slightly to make the grouping a bit more logical. The user manual has been changed to make sure the order in the manual is the same as in the M32.

#### New Feature(s):

* Implementation of a serial protocol (see separate documentation on GitHub).

This allows (through some software on a computer connected through USB) screen or voice output of menus and settings (e.g. making the M32 usable for blind or visually impaired people), and also allows remote control of all Morserino features from the computer (like setting parameters, managing snapshots, changing speed, exiting and entering menus, uploading text files and even automated keying). The protocol is described in a separate document.
* LoRa output power is now configurable through the Hardware Config Menu, and can be set between 10 and 100 mW (10 - 20 dBm); previously it always used the default of 25 mW (14 dBm). Be aware that some countries have restriction regarding maximal power of LoRa - so check your mileage before changing the default to something higher!


### Changes V.4.5.2

#### Bug Fix(es):
Expand Down
Binary file added Software/binary/m32_v5.ino.wifi_lora_32_V2.bin
Binary file not shown.
1 change: 1 addition & 0 deletions Software/binary/m32_v5.ino.wifi_lora_32_V2.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
48b51c6ddc5497f0d7f3b1e3619a8f95
129 changes: 129 additions & 0 deletions Software/src/Version 5/ClickButton.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/* ClickButton
Based on an Arduino librery by [email protected] that decodes multiple clicks on one button.
Also copes with long clicks and click-and-hold.
Usage: ClickButton buttonObject(pin [LOW/HIGH, [CLICKBTN_PULLUP]]);
where LOW/HIGH denotes active LOW or HIGH button (default is LOW)
CLICKBTN_PULLUP is only possible with active low buttons.
Returned click counts:
A positive number denotes the number of (short) clicks after a released button
A negative number denotes the number of "long" clicks
Copyright (C) 2010,2012, 2013 raron
GNU GPLv3 license
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact: [email protected]
*/

#include "ClickButton.h"


ClickButton::ClickButton(uint8_t buttonPin)
{
pin = buttonPin;
activeHigh = LOW; // Assume active-low button
_btnState = !activeHigh; // initial button state in active-high logic
_lastState = _btnState;
_clickCount = 0;
clicks = 0;
depressed = false;
_lastBounceTime= 0;
debounceTime = 20; // Debounce timer in ms
multiclickTime = 250; // Time limit for multi clicks
longClickTime = 1000; // time until long clicks register
pinMode(pin, INPUT);
}

/*
ClickButton::ClickButton(uint8_t buttonPin, boolean activeType)
{
pin = buttonPin;
_activeHigh = activeType;
_btnState = !_activeHigh; // initial button state in active-high logic
_lastState = _btnState;
_clickCount = 0;
clicks = 0;
depressed = 0;
_lastBounceTime= 0;
debounceTime = 20; // Debounce timer in ms
multiclickTime = 250; // Time limit for multi clicks
longClickTime = 1000; // time until long clicks register
pinMode(pin, INPUT);
}
ClickButton::ClickButton(uint8_t buttonPin, boolean activeType, boolean internalPullup)
{
pin = buttonPin;
_activeHigh = activeType;
_btnState = !_activeHigh; // initial button state in active-high logic
_lastState = _btnState;
_clickCount = 0;
clicks = 0;
depressed = 0;
_lastBounceTime= 0;
debounceTime = 20; // Debounce timer in ms
multiclickTime = 250; // Time limit for multi clicks
longClickTime = 1000; // time until "long" click register
pinMode(pin, INPUT);
// Turn on internal pullup resistor if applicable
if (_activeHigh == LOW && internalPullup == CLICKBTN_PULLUP) digitalWrite(pin,HIGH);
}
*/

void ClickButton::Update()
{
long now = (long)millis(); // get current time
_btnState = digitalRead(pin); // current appearant button state

// Make the button logic active-high in code
if (!activeHigh) _btnState = !_btnState;

// If the switch changed, due to noise or a button press, reset the debounce timer
if (_btnState != _lastState) _lastBounceTime = now;


// debounce the button (Check if a stable, changed state has occured)
if (now - _lastBounceTime > debounceTime && _btnState != depressed)
{
depressed = _btnState;
if (depressed) _clickCount++;
}

// If the button released state is stable, report nr of clicks and start new cycle
if (!depressed && (now - _lastBounceTime) > multiclickTime)
{
// positive count for released buttons
clicks = _clickCount;
_clickCount = 0;
}

// Check for "long click"
if (depressed && (now - _lastBounceTime > longClickTime))
{
// negative count for long clicks
clicks = 0 - _clickCount;
_clickCount = 0;
}

_lastState = _btnState;
}
36 changes: 36 additions & 0 deletions Software/src/Version 5/ClickButton.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#ifndef ClickButton_H
#define ClickButton_H

#if (ARDUINO < 100)
#include <WProgram.h>
#else
#include <Arduino.h>
#endif


//#define CLICKBTN_PULLUP HIGH


class ClickButton
{
public:
ClickButton(uint8_t buttonPin);
// ClickButton(uint8_t buttonPin, boolean active);
// ClickButton(uint8_t buttonPin, boolean active, boolean internalPullup);
void Update();
int clicks; // button click counts to return
boolean depressed; // the currently debounced button (press) state (presumably it is not sad :)
long debounceTime;
long multiclickTime;
long longClickTime;
uint8_t pin; // Arduino pin connected to the button - now public to chaneg assignement at runtime
boolean activeHigh; // Type of button: Active-low = 0 or active-high = 1

private:
boolean _btnState; // Current appearant button state
boolean _lastState; // previous button reading
int _clickCount; // Number of button clicks within multiclickTime milliseconds
long _lastBounceTime; // the last time the button input pin was toggled, due to noise or a press
};

#endif
Loading

0 comments on commit 425bde1

Please sign in to comment.