wulie88 / arms22

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

SoftModem Library with Arduino 1.0 #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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);
    }
  }
}

Original issue reported on code.google.com by mattiafr...@gmail.com on 2 Feb 2012 at 12:27

GoogleCodeExporter commented 9 years ago
hello! I'm having the same error. Do you already have the solution? Thank you

Original comment by pdr...@gmail.com on 7 Feb 2012 at 10:09

GoogleCodeExporter commented 9 years ago
This is a patch which update the compatibility for the old and the new arduino.

Original comment by mattiafr...@gmail.com on 10 Feb 2012 at 3:08

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Ok forget my previous comment, here is a patched version of SoftModem, worked 
perfectly , thanks mattia :) 

Original comment by yehy...@gmail.com on 20 Feb 2012 at 3:13

Attachments:

GoogleCodeExporter commented 9 years ago
Had the same issue, resolved by the above patch.  Thanks for contributing.

Original comment by toddwpr...@gmail.com on 27 May 2012 at 3:48

GoogleCodeExporter commented 9 years ago
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

Original comment by technic...@gmail.com on 27 Jul 2012 at 4:29

GoogleCodeExporter commented 9 years ago
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.

Original comment by jaiber...@gmail.com on 3 Sep 2012 at 9:42

GoogleCodeExporter commented 9 years ago
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

Original comment by adam.h.m...@gmail.com on 19 Nov 2012 at 8:37

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

Original comment by ruy.teix...@gmail.com on 8 Sep 2013 at 4:26