Welcome to my Website!

This is a paragraph! Here's how you make a link: Neocities.

Here's how you can make bold and italic text.

Here's how you can add an image:

Here's how to make a list:

To learn more HTML/CSS, check out these tutorials!

ASCII (American Standard Code for Informaction Interchange) table: Converts letters into a numeric code, : Char / ASCII code (decimal) a - z / 97-122 A - z / 65-90 o - q /48-57 S /83,32 O /79 S /83 space /32 null character / \0 (final)

    
    // Morse code for blinking a LED
int ledPin = 13; //int means intger  a type of variable.
int dotDelay = 200;

char* letters[] = { // [] means an array with the name letters for the array, char is a type of variable meaning chracter, "*" is a pointer, it points to the character of the array in order.
  ".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..",    // A-I
  ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.",  // J-R
  "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."          // S-Z
};


//It is a second array for numbers 0 to 9, these two arrays are arrays of arrays, also as now as an array of string literals, example of string literal: ...---(another could be: az8mhello, bacuse string is as several character together like a word.String litral can be bamed string)
//We cuold think as an array of an array of character.


char* numbers[] = { 
  "-----", ".----", "..---", "...--", "....-", ".....", "-....", "--...", "---..", "----."};

// If i write letters[0] it meeans .- because is the fisrt element of the array letters, and letter[26] is --..
//Afterwords .- will mean A and --.. will mean z.

void setup(){
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

void loop(){
  char ch;
  if (Serial.available() > 0){
    ch = Serial.read();
    if (ch >= 'a' && ch <= 'z')
    {
      flashSequence(letters[ch - 'a']);
    }
    else if (ch >= 'A' && ch <= 'Z')
    {
      flashSequence(letters[ch - 'A']);
    }
    else if (ch >= '0' && ch <= '9')
    {
      flashSequence(numbers[ch - '0']);
    }
    else if (ch == ' ')
    {
      delay(dotDelay * 4);  // gap between words  
    }
  }
}

void flashSequence(char* sequence){
  int i = 0;
  while (sequence[i] != NULL)
  {
    flashDotOrDash(sequence[i]);
    i++;
  }
  delay(dotDelay * 3);    // gap between letters
}

void flashDotOrDash(char dotOrDash){
  digitalWrite(ledPin, HIGH);
  if (dotOrDash == '.')
  {
    delay(dotDelay);           
  }
  else // must be a dash
  {
    delay(dotDelay * 3);           
  }
  digitalWrite(ledPin, LOW);    
  delay(dotDelay); // gap between flashes
}