Teensy 2.0 , PlatformIO – morse code blinker

main.cpp :

/*
 * Morse Code
 * Turns on the internal LED based on the morse code schema,

*  https://en.wikipedia.org/wiki/Morse_code
 * then off for one second, repeatedly.
 */

#include "Arduino.h"

void l()
{
  // turn the LED on (HIGH is the voltage level)
  digitalWrite(LED_BUILTIN, HIGH);
  // wait for a second
  delay(500);
  // turn the LED off by making the voltage LOW
  digitalWrite(LED_BUILTIN, LOW);
   // wait for a second
  delay(200);
}

void s()
{
  // turn the LED on (HIGH is the voltage level)
  digitalWrite(LED_BUILTIN, HIGH);
  // wait for a second
  delay(200);
  // turn the LED off by making the voltage LOW
  digitalWrite(LED_BUILTIN, LOW);
   // wait for a second
  delay(200);
}

void w()
{
  // turn the LED off by making the voltage LOW
  digitalWrite(LED_BUILTIN, LOW);
   // wait for a second
  delay(1000);
}

void morseTranslator(char c)
{
  if (c == 'a' || c == 'A') {s();l();}
  if (c == 'b' || c == 'B') {l();s();s();s();}
  if (c == 'c' || c == 'C') {l();s();l();s();}
  if (c == 'd' || c == 'D') {l();s();s();}
  if (c == 'e' || c == 'E') {s();}
  if (c == 'f' || c == 'F') {s();s();l();s();}
  if (c == 'g' || c == 'G') {l();l();s();}
  if (c == 'h' || c == 'H') {s();s();s();s();}
  if (c == 'i' || c == 'I') {s();s();}
  if (c == 'j' || c == 'J') {s();l();l();l();}
  if (c == 'k' || c == 'K') {l();s();l();}
  if (c == 'l' || c == 'L') {s();l();s();s();}
  if (c == 'm' || c == 'M') {l();l();}
  if (c == 'n' || c == 'N') {l();s();}
  if (c == 'o' || c == 'O') {l();l();l();}
  if (c == 'p' || c == 'P') {s();l();l();s();}
  if (c == 'q' || c == 'Q') {l();l();s();l();}
  if (c == 'r' || c == 'R') {s();l();s();}
  if (c == 's' || c == 'S') {s();s();s();}
  if (c == 't' || c == 'T') {l();}
  if (c == 'u' || c == 'U') {s();s();l();}
  if (c == 'v' || c == 'V') {s();s();s();l();}
  if (c == 'w' || c == 'W') {s();l();l();}
  if (c == 'x' || c == 'X') {l();s();s();l();}
  if (c == 'y' || c == 'Y') {l();s();s();l();l();}
  if (c == 'z' || c == 'Z') {l();l();s();s();}
  w();
  //l();l();l();w(); s(); s(); s(); w(); l(); l();l();w();
}

void setup()
{
  // initialize LED digital pin as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop()
{
  morseTranslator('s');
  morseTranslator('o');
  morseTranslator('s');
  w();
}

Installing PlatformIO for Teensy 2.0 on Ubuntu 16.04

I have a Teensy 2.0 and a laptop running Ubuntu 16.04
I started to Install the standard Arduino ide but it doesn’t support teensy out of the box.
I found a nice guide  to add the teensy as an addon to the arduino studio but it took me to much time to start and reconfigure it, so I googled  and found the PlatformIO

PlatformIO is based on github atom ide

In Atom :

Menu: Edit > Preferences > Install

search fo : platformio-ide
../_images/ide-atom-platformio-install.png
and you can start working