Export to GitHub

arms22 - issue #2

SoftModem Library with Arduino 1.0


Posted on Feb 2, 2012 by Swift Bird
  1. Copy the SoftModem-004.zip in library
  2. Copy the example in a new file
  3. Compile with arduino 1.0 ide

Compilation fails with error:

In file included from softmodem.cpp:1: /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.h:72: error: conflicting return type specified for 'virtual void SoftModem::write(uint8_t)' /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'

This is the example:

include <SoftModem.h>

include <ctype.h>

SoftModem modem;

void setup() { Serial.begin(57600); delay(1000); modem.begin(); }

void loop() { while(modem.available()){ int c = modem.read(); if(isprint(c)){ Serial.println((char)c); } else{ Serial.print("("); Serial.print(c,HEX); Serial.println(")");
} } if(Serial.available()){ modem.write(0xff); while(Serial.available()){ char c = Serial.read(); modem.write(c); } } }

Comment #1

Posted on Feb 7, 2012 by Massive Bird

hello! I'm having the same error. Do you already have the solution? Thank you

Comment #2

Posted on Feb 10, 2012 by Swift Bird

This is a patch which update the compatibility for the old and the new arduino.

Attachments

Comment #3

Posted on Feb 18, 2012 by Quick Hippo

Comment deleted

Comment #4

Posted on Feb 20, 2012 by Quick Hippo

Ok forget my previous comment, here is a patched version of SoftModem, worked perfectly , thanks mattia :)

Attachments

Comment #5

Posted on May 27, 2012 by Happy Bear

Had the same issue, resolved by the above patch. Thanks for contributing.

Comment #6

Posted on Jul 27, 2012 by Quick Cat

Hello I have had similar problems as above. Would someone mind reposting the patch? Google says the link is invalid. Thanks for the info!

-Nick

Comment #7

Posted on Sep 3, 2012 by Helpful Lion

I tried to use SoftModem with arduino pro mini (3.3v, 8MHz), but the demodulation process doesn´t work. When i use the arduino uno everything work very fine. Could you help me please.

Comment #8

Posted on Nov 19, 2012 by Massive Rhino

With arduino 1.0.1 I get the following compile errors using the patched version:

/Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp: In member function 'void SoftModem::begin()': /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:109: error: 'TCNT2' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:112: error: 'TCCR2A' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:113: error: 'TCCR2B' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp: In member function 'void SoftModem::end()': /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:120: error: 'TIMSK2' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:120: error: 'OCIE2A' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp: In member function 'void SoftModem::demodulate()': /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:139: error: 'TCNT2' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:142: error: 'TIFR2' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:142: error: 'TOV2' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:170: error: 'OCR2A' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:171: error: 'TIFR2' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:171: error: 'OCF2A' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:172: error: 'TIMSK2' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:172: error: 'OCIE2A' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp: In member function 'void SoftModem::recv()': /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:235: error: 'TIMSK2' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:235: error: 'OCIE2A' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp: In function 'void TIMER2_COMPA_vect()': /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:247: error: 'OCR2A' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp: In member function 'void SoftModem::modulate(uint8_t)': /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:284: error: 'OCR2B' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:285: error: 'TIFR2' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:285: error: 'OCF2B' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:290: error: 'OCR2B' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:291: error: 'TIFR2' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftModem/SoftModem.cpp:291: error: 'OCF2B' was not declared in this scope

Has anyone else had this problem?

Thanks!

Adam

Comment #9

Posted on Sep 8, 2013 by Helpful Panda

Hello, I'm trying to get new high and low frequencies, but demodulation doesn't work.Could you give me a tip?

Status: New

Labels:
Type-Defect Priority-Medium