Ok, I could finally figure it out. Apparently I had to use a serial USB. I attach the code with an example so everyone that needs it can benefit from it:
//-------------------------------------------------------------------------------
//
// This example should help new users to communicate to their tinyarcades via serial port
//
// Written by Pablo Jimenez Mateo
//-------------------------------------------------------------------------------
#include <Wire.h>
#include <TinyScreen.h>
TinyScreen display = TinyScreen(TinyScreenPlus);
void setup(void) {
Wire.begin();//initialize I2C before we can initialize TinyScreen- not needed for TinyScreen+
display.begin();
display.setBrightness(10);
//This is for serial communication
USBDevice.init();
USBDevice.attach();
SerialUSB.begin(9600);
}
void loop() {
delay(1500);
SerialUSB.println("Hi");
String cmd = "";
//Read an entire line from serial
while (SerialUSB.available() > 0) {
cmd += (char)SerialUSB.read();
}
if (cmd.length() > 2) {
writeText(cmd);
} else {
writeText("No text :(");
}
}
void writeText(String text){
//String to char*
char t[text.length()+1];
text.toCharArray(t, text.length() + 1);
display.clearScreen();
//setFont sets a font info header from font.h
//information for generating new fonts is included in font.h
display.setFont(thinPixel7_10ptFontInfo);
int width = display.getPrintWidth(t);
//setCursor(x,y);//set text cursor position to (x,y)- in this example, the example string is centered
display.setCursor(48-(width/2),20);
//fontColor(text color, background color);//sets text and background color
display.fontColor(TS_8b_Green,TS_8b_Black);
display.print(t);
}