Programming Homework Help
San Diego State University Generic Morse Code Transmission Worksheet
Get Your Custom Essay Written From Scratch
We have worked on a similar problem. If you need help click order now button and submit your assignment instructions.
Just from $13/Page
A simple function to determine the letter to translate into Morse code and call the right functions for blinking pattern:
if (s[i] == ‘A’ || s[i] == ‘a’)
{
dot(); dash(); spc();
}
example
#define F_CPU 16000000UL // 16MHz clock from the debug processor
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
/* Replace with your application code */
DDRB |= (1<<DDB5); //0x20 (hex) // Set port bit B5 in data direction register to 1: an OUTput
while(1)
{
PORTB |= (1<<PORTB5); //Set port bit B5 to 1 to turn on the LED
_delay_ms(100); //delay 100ms
PORTB &= ~(1<<PORTB5); //Clear port bit B5 to 0 to turn off the LED
_delay_ms(100);
}
}