1 of 21

River City ARCSGeneral Membership Meeting

March 4, 2014

  • Introduction to Arduino – Part 2� A Software Morse/RTTY Sender

2 of 21

Learning Computer of the 80’s

3 of 21

$99 Sinclair ZX81 Kit

4 of 21

Typical ZX81 Set Up

5 of 21

Today’s $29 Learning Computer

6 of 21

What is a Microcontroller?

http://www.freescale.com/files/microcontrollers/doc/ref_manual/M68HC05TB.pdf

ANALOG�INPUTS

What is the difference between a ‘Digital Input’ and an ‘Analog Input’?

7 of 21

Terminology

    • I/O Board - main microcontroller
    • Shield - add-on boards
    • Sketch - the program
    • Sensor - components (thermistors, etc.)
    • Modules - serial data (GPS module, etc.)

8 of 21

Shields

APRS Shield

Ethernet Shield

Touchscreen Shield

9 of 21

Sensors

Photo/thermistor, infared, force sensitive resistor, Hall effect, Piezo, tilt sensor..

10 of 21

Sketches

Includes

Globals

void setup()

void loop()

11 of 21

Applications - APRS

Argent Data

Trackduino

12 of 21

Arduino Controlled Tuner

13 of 21

Morse Encoder

http://www.multiwingspan.co.uk/

14 of 21

Morse Encoder Flow Chart

15 of 21

Morse Encoder - Sketch

/* � Piezo Element Morse Code Sketch� � */��const int buzzerPin = 9;�const int ledPin = 7; CHANGE to pin 13 (on board LED)// tone frequency C�const int tonefreq = 523; CHANGE to 2500 (louder piezo output) �// constants for tone and rest durations�const int dotlength = 100;�const int dashlength = dotlength * 3;�// inter-element gap - between each dot or dash of a letter�const int inter = dotlength; �// letter gap is 3 dots - the inter gap is always added - so this is one fewer�const int lgap = dotlength * 2; // inter-letter gap�// word gap is 7 dots - with letter and inter gap already counted, this is -1�const int wgap = dotlength * 4; //inter-word gap�…

16 of 21

Sketch – Character Routines

void dot()�{�  // play a dot�  tone(buzzerPin, tonefreq);�  // LED�  digitalWrite(ledPin, HIGH);�  delay(dotlength);�  noTone(buzzerPin);�  // LED�  digitalWrite(ledPin, LOW);�  delay(inter);�}��void dash()�{�  // play a dash�  tone(buzzerPin, tonefreq);�  // LED�  digitalWrite(ledPin, HIGH);�  delay(dashlength);�  noTone(buzzerPin);�  // LED�  digitalWrite(ledPin, LOW);�  delay(inter);�}

17 of 21

Morse Character Table

void soundLetter(char letter)�{�  // letters are in order of frequency�  switch(letter)�  {�  case 'E':�    dot();�    return; �  case 'T':�    dash();�    return; �  case 'A':�    dot();�    dash();�    return;�  case 'O':�    dash();�    dash();�    dash();�    return; �  case 'I':�    dot();�    dot();�    return;

18 of 21

RTTY Encoder

http://www.timzaman.com/?p=138

19 of 21

RTTY Encoder Flow Chart

20 of 21

RTTY Sketch - Changes

// Transmit a bit as a mark or space

void rtty_txbit (int bit) {

if (bit) {

// High - mark

digitalWrite(2, HIGH); CHANGE TO tone(buzzerPin, markfreq); (2295)

digitalWrite(3, LOW); CHANGE TO digitalWrite(ledPin, HIGH);

}

else {

// Low - space

digitalWrite(3, HIGH); CHANGE TO tone(buzzerPin, spacefreq); (2125)

digitalWrite(2, LOW); CHANGE TO digitalWrite(ledPin, LOW);

}

// Delay appropriately - tuned to 50 baud.

delay(20); CHANGE TO delay(22.222); (45 baud)

//delayMicroseconds(250);

}

21 of 21

Questions?