Manchester help

I'm using the mchr3k Manchester library and I would like to output a string of Manchester out pin 9, feed it into pin 10, and then print the received data into the Serial monitor. What code do I need to write to accomplish this? This is the code I tried but I know its probably way wrong:

#include <SoftwareSerial.h>

#include <Manchester.h>

void setup()
{
  man.setupTransmit(9, MAN_1200);
  man.setupReceive(10, MAN_1200);
  man.beginReceive();
}
void loop() {
  man.transmit(1);
  if (man.receiveComplete()) {
  uint16_t m = man.getMessage();
  man.beginReceive(); //start listening for next message right after you retrieve the message
    //do something with your message here
    Serial.println(uint16_t);  
    }
}

Thanks

The Manchester library is meant to be used with two Arduinos, one to transmit Manchester encoded data, the other to receive it.

One Arduino can't possibly send and receive to itself.

jremington:
The Manchester library is meant to be used with two Arduinos, one to transmit Manchester encoded data, the other to receive it.

One Arduino can't possibly send and receive to itself.

So its 100% impossible?

Look at the library code, if you don't believe me.

jremington:
Look at the library code, if you don't believe me.

Which file? .h?

Oh, come on! arduino-libs-manchester/Manchester.cpp at master · mchr3k/arduino-libs-manchester · GitHub

jremington:
Oh, come on! arduino-libs-manchester/Manchester.cpp at master · mchr3k/arduino-libs-manchester · GitHub

Ok, I'm sorry, I don't know what does what in libraries. I honestly don't know what I need to be looking at.

pianocorder_man:
I'm using the mchr3k Manchester library and I would like to output a string of Manchester out pin 9, feed it into pin 10, and then print the received data into the Serial monitor. ...

What exactly are you trying to accomplish?

pantaz:
What exactly are you trying to accomplish?

Well, right now, I'm just experimenting, but later on, I'd like to use Manchester from a cassette to control Arduino pins directly.

Ok, so I started using the library found here:
http://forum.arduino.cc/index.php?topic=63755.0

What I did was I made it simply transmit "1" and then delay as can be seen here:

#include <MANCHESTER.h>


  //the digital pin to use to transmit data

unsigned int Tdata = 0;  //the 16 bits to send

void setup()
{                
MANCHESTER.SetTxPin(5);      // sets the digital pin as output default 4
 MANCHESTER.SetRxPin(4); //user sets rx pin default 4
}//end of setup

void loop()
{
 MANCHESTER.Transmit(1);
  delay(2000);
}//end of loop

I then fed this into my audio card, then fed it back into the decoder using this code:

#include <MANCHESTER.h>


  //the digital pin to use to transmit data

unsigned int Tdata = 0;  //the 16 bits to send

void setup()
{                

 MANCHESTER.SetRxPin(5); //user sets rx pin default 4
 MANCHESTER.SetTimeOut(1000); //user sets timeout default blocks
   Serial.begin(9600); // Debugging only
}//end of setup

void loop()
{

 Tdata +=1;
     unsigned int data = MANCHESTER.Receive();

 Serial.println(data);


}//end of loop

Does anybody know why I would be getting random data in the Serial monitor?

The Manchester library sends digital signals with varying pulse characteristics. This is not an audio signal, and ordinary audio equipment cannot be used to store and reproduce it at the 5 V levels needed by the Arduino.

A cassette recorder can work under certain circumstances, with the proper interface.

To test the Manchester library, connect two Arduinos by wires and run the transmitter portion on one and the receiver portion on the other.

jremington:
The Manchester library sends digital signals with varying pulse characteristics. This is not an audio signal, and ordinary audio equipment cannot be used to store and reproduce it at the 5 V levels needed by the Arduino.

A cassette recorder can work under certain circumstances, with the proper interface.

To test the Manchester library, connect two Arduinos by wires and run the transmitter portion on one and the receiver portion on the other.

How would I interface it for a cassette?

Google can help. There are lots of possibilities.
Why are you fixated on Manchester encoding?

jremington:
Google can help. There are lots of possibilities.
Why are you fixated on Manchester encoding?

Mainly because of its ability to be put on a cassette. Do you know of any other coding techniques that can be put on maybe a CD instead of a cassette? Also, I couldn't fund anything on google.

Look here.

jremington:
Look here.

Thanks very much, I didn't exactly know what to search. Would a circuit like this work?
http://www.classiccmp.org/dunfield/altair/d/cassette.pdf

Yes, but there are simpler ones here: QUEST Super ELF, Netronics ELF II Cassette tape support

jremington:
Yes, but there are simpler ones here: QUEST Super ELF, Netronics ELF II Cassette tape support

Is there no IC's in the circuit? I sometimes overlook them when they are in diagram form. Edit: I see them now, the 4049's. Ok, so what exactly does what in the first one on the page you linked? (http://www.retrotechnology.com/restore/cass_super.jpg) There looks to be four unconnected circuits.

The top circuit takes the cassette audio output and converts it into a digital signal (EF3). The jumpers allow you to select normal or inverted signals.

The bottom circuit takes the digital output (Q) and sends it to the microphone input via a 47K resistor. The jumpers allow you to select normal or inverted signals.

You might have better luck with the next pair of circuits, for the ELF II.

jremington:
The top circuit takes the cassette audio output and converts it into a digital signal (EF3). The jumpers allow you to select normal or inverted signals.

The bottom circuit takes the digital output (Q) and sends it to the microphone input via a 47K resistor. The jumpers allow you to select normal or inverted signals.

You might have better luck with the next pair of circuits, for the ELF II.

I know this is old, but do you know if this will work with bauds rate higher than the 300 its was originally designed for?