lfdebrux / rogue-code

Automatically exported from code.google.com/p/rogue-code
0 stars 0 forks source link

RogueMP3 Arduino library with Arduino 1.0 #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
NewSoftSerial is now part of Arduino 1.0 under SoftwareSerial 
<http://arduino.cc/en/Reference/SoftwareSerial>

Examples should updated for Arduino 1.0

#include <RogueMP3.h>
#include <SoftwareSerial.h>

SoftwareSerial rmp3_serial(6, 7);

and the RogueMP3 needs a small update as Serial.write() now returns size_t 
instead of void. Changes are needed on line 155 in RogueMP3.h and line 518 in 
RogueMP3.cpp

Original issue reported on code.google.com by camillem...@gmail.com on 15 Mar 2012 at 1:09

GoogleCodeExporter commented 8 years ago
More specifically, to make the lib back-compatible, one might consider these 
lib mods:

Replace line 155 in RogueMP3.h:
void write(uint8_t);
With:
#if ARDUINO >= 100
  size_t write(uint8_t);  // needed for Print
#else
   void write(uint8_t);
#endif

Replace line 518 in RogueMP3.cpp:
void RogueMP3::write(uint8_t c)
With:
#if ARDUINO >= 100
    size_t RogueMP3::write(uint8_t c)
#else
    void RogueMP3::write(uint8_t c)
#endif

Make the sketch mods as described above to use the "new" SoftwareSerial, and 
CHOOSE A NON- "stream" BOARD, in fact you may wish to eliminate 
hardware/arduino-stream core mods from your sketchbook as they no longer seem 
necessary... though I have not exhaustively tested all rMP3 functionality since 
making the changes.

Cheers,
-r

Original comment by rgrue...@exploratorium.edu on 4 May 2012 at 8:02