I wrote simple code for my Digispark (Attiny85 with Micronucleus bootloader) in Arduino IDE:

#include <DigiUSB.h>

String inst;

void setup() {
  pinMode(1, OUTPUT);

void loop() {
  if (DigiUSB.available()) {

    char inp = DigiUSB.read();

    if (inp == '\n') { 
      inst = "";

    else {
      inst += inp;


DigiUSB works just like Serial communication in classic boards

If i send string and newline char i expect it to output this string back and print its length, but instead i receiving null string and 0 in any case

Is it problem with code or microcontroller itself?

DigiUSB monitor software

EDIT: Its seems to be digispark library problem itself:

DigiUSB.println() and DigiUSB.print() accept only char arrays

Also, there is no toCharArray() from classic arduino lib and no c_str() so i cant use atoi()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.