Author Topic: serial library with parseInt.  (Read 3321 times)

ajh51

  • Newbie
  • *
  • Posts: 2
serial library with parseInt.
« on: November 02, 2016, 06:08:21 am »
Hi - I'm new to Digispark although I have some Arduino experience and am a hardware guy in my day job.

I want to use a serial RX on Digispark to receive a data stream being broadcast from another Arduino.  I need a serial library on Digispark to support "parseInt" but I can't find one - everything I've tried gives a "....... class has no member named 'parseInt'" compile error.  Searching on here suggests the standard included library supports this but that doesn't seem to be the case.

Can anyone suggest a serial library that contains the parseInt functionality please? 

thanks,
Andy.

RC Navy

  • Jr. Member
  • **
  • Posts: 54
  • When you like, even too much, it is not enough!
Re: serial library with parseInt.
« Reply #1 on: November 02, 2016, 11:56:02 am »
Hi ajh51,

the issue is due to the Stream.h file provided with the Digispark core. This Stream.h is completely out of date compared to the one include with the standard arduino core.

To fix this, just replace the Stream.h file of the Digispark core (path: digistump/hardware/avr/1.6.7/cores/tiny) by the Stream.h AND Stream.cpp files coming from the standard arduino core (path: arduino-1.6.12/hardware/arduino/avr/cores/arduino).

I did a quick test with the SoftSerial library: it compiles fine. It should work fine as well with SoftwareSerial.

Enjoy,

ajh51

  • Newbie
  • *
  • Posts: 2
Re: serial library with parseInt.
« Reply #2 on: November 03, 2016, 08:31:42 am »
That has indeed sorted it - many thanks for a quick, detailed and knowledgeable response.

best,
Andy.