#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h> 

#define SCREEN_WIDTH 128 
#define SCREEN_HEIGHT 64 

#define OLED_RESET -1 
#define SCREEN ADDRESS 0x3D
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);



void setup() {


  Serial.begin(9600);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(10, 10);
  display.print("Jan MIhelj           ");
  display.println("22.10.2007");
  display.display();
  delay(2000);
}

void loop() {

  display.display();
   


  crka_J();
  delay(300);
  crka_A();
  delay(300);
  crka_N();
  delay(300);

}
void crka_A()
{
Serial.print("A");
Serial.print("._ ");
pisk(50); 
delay(100);
pisk(200);
delay(100);
}

void crka_B()
{
Serial.print("B");
Serial.print("_... ");
pisk(200);
delay(100);
pisk(50);
delay(100);
pisk(50);
delay(100);
pisk(50);
delay(100);
}

void crka_C()
{
Serial.print("C");
Serial.print("_._. ");
pisk(200);
delay(100);
pisk(50);
delay(100);
pisk(200);
delay(100);
pisk(50);
delay(100);
}

void crka_D()
{
Serial.print("D");
Serial.print("_.. ");
pisk(200);
delay(100);
pisk(50);
delay(100);
pisk(50);
delay(100);

}

void crka_E()
{
Serial.print("E");
Serial.print(". ");
pisk(50);
delay(100);
}

void crka_F()
{
Serial.print("F");
Serial.print(".._. ");
pisk(50);
delay(100);
pisk(50);
delay(100);
pisk(200);
delay(100);
pisk(50);
delay(100);
}

void crka_G()
{
Serial.print("G");
Serial.print("_ _. ");
pisk(200);
delay(100);
pisk(200);
delay(100);
pisk(50); 
delay(100);
}

void crka_H()
{
Serial.print("H");
Serial.print(".... ");
pisk(50); 
delay(100);
pisk(50); 
delay(100);
pisk(50); 
delay(100);
pisk(50); 
delay(100);
}

void crka_I()
{
Serial.print("I");
Serial.print(".. ");
pisk(50); 
delay(100);
pisk(50); 
delay(100);
}

void crka_J()
{
Serial.print("J");
Serial.print("._ _ _ ");
pisk(50); 
delay(100);
pisk(200);
delay(100);
pisk(200);
delay(100);
pisk(200); 
delay(100);
}

void crka_K()
{
Serial.print("K");
Serial.print("_._ ");
pisk(200);
delay(100);
pisk(50); 
delay(100);
pisk(200);
delay(100);
}

void crka_L()
{
Serial.print("L");
Serial.print("._.. ");
pisk(50); 
delay(100);
pisk(200);
delay(100);
pisk(50);
delay(100);
pisk(50); 
delay(100);
}

void crka_M()
{
Serial.print("M");
Serial.print("_ _ ");
pisk(200);
delay(100);
pisk(200);
delay(100);
}

void crka_N()
{
Serial.print("N");
Serial.print("_. ");
pisk(200);
delay(100);
pisk(50);
delay(100);
}

void crka_O()
{
Serial.print("O");
Serial.print("_ _ _ ");
pisk(200);
delay(100);
pisk(200);
delay(100);
pisk(200); 
delay(100);
}

void crka_P()
{
Serial.print("P");
Serial.print("._ _. ");
pisk(50); 
delay(100);
pisk(200);
delay(100);
pisk(200);
delay(100);
pisk(50); 
delay(100);
}

void crka_Q()
{
Serial.print("Q");
Serial.print("_ _._ ");
pisk(200);
delay(100);
pisk(200);
delay(100);
pisk(50); 
delay(100);
pisk(200); 
delay(100);
}

void crka_R()
{
Serial.print("R");
Serial.print("._. ");
pisk(50);
delay(100);
pisk(200);
delay(100);
pisk(50); 
delay(100);
}

void crka_S()
{
Serial.print("S");
Serial.print("... ");
pisk(50); 
delay(100);
pisk(50); 
delay(100);
pisk(50); 
delay(100);
}

void crka_T()
{
Serial.print("T");
Serial.print("_ ");
pisk(200);
delay(100);
}

void crka_U()
{
Serial.print("U");
Serial.print(".._ ");
pisk(50); 
delay(100);
pisk(50); 
delay(100);
pisk(200);
delay(100);
}

void crka_W()
{
Serial.print("W");
Serial.print("._ _ ");
pisk(50); 
delay(100);
pisk(200);
delay(100);
pisk(200);
delay(100);
}
void crka_X()
{
Serial.print("X");
Serial.print("_.._ ");
pisk(200);
delay(100);
pisk(50); 
delay(100);
pisk(50); 
delay(100);
pisk(200);
delay(100);
}

void crka_Y()
{
Serial.print("Y");
Serial.print("_._ _ ");
pisk(200);
delay(100);
pisk(50); 
delay(100);
pisk(200);
delay(100);
pisk(200); 
delay(100);
}
void crka_Z()
{
Serial.print("Z");
Serial.print("_ _.. ");
pisk(200);
delay(100);
pisk(200);
delay(100);
pisk(50); 
delay(100);
pisk(50); 
delay(100);
}

void pisk (int dolzina)
{
  tone(11,800);
  delay(dolzina);
  noTone(11);
}