Expand description
Iterators over text in morse code.
fn wait_for(duration: u8) {
// ...
}
fn beep_for(duration: u8) {
// ...
}
for action in small_morse::encode("Hello in morse code!") {
if action.state == small_morse::State::On {
beep_for(action.duration);
} else {
wait_for(action.duration);
}
}This library is for encoding text into morse code (not the other way around yet).
It works without the standard library.
Structs§
- Action
- An
Actionis how the library tells you what to signal. - Morse
Iter - A
MorseIteris an iterator that yieldsActions. Create aMorseIterwith either theMorseIter::newmethod or theiterfunction.
Enums§
- Delay
Type DelayTypeindicates whether a duration should be slowed down when using the Farnsworth method of learning Morse code.- State
- Within an
Action, whether it is to turn the signalling mechanism on or off
Functions§
- encode
- Creates an iterator over the
Actions necessary to send the message