Sending and receiving Analog signal

Hey guys, so im new to this. But what im trying to do is, ive got 2 Uno's.

Im trying to send a Analog value from Arduino A to arduino B. Its 100metres of Cat cable between the two.

Currently im just doing a analogWrite(6, 100); on my Arduino A, and analogRead(15); on my Arduino B.

i set up serial.println of the input, and all i get is 0 and 255 nothing inbetween.

Any of you guys know how to solve this?

Cheers !

I'm currently building an instrument that needs to do almost exactly what you are trying to do.

First of all analog signals are not meant to travel that far. There is a voltage drop in wire that becomes noticeable after a certain distance. For my cable it's 1.3 volts per 100 ft. It also picks up noise from the environment. So even if you could manage to send an analog signal over that distance it would be useless.

A better way is to use RS485 and the serial port. RS485 is an electrical standard for serial communication that allows signals to be sent over 1000 meters. It is also commonly used over Cat cable. Just connect A to A, B to B over a twisted pair and ground to ground. There are other communication types but most of them are not meant to transmit over that type of distance.

You can buy an RS485 shield. They often come with good instructions that allow you to get started right away.

Another route is to use a MAX485 chip. This takes the arduino TTL serial and changes it to the RS485 standard. It uses the built in serial library so it is easy to use. The biggest difference is you have to set it to transmit or receive mode using a digital pin.

Here is an example that helped me understand. They also sell RS485 communication modules.
https://arduino-info.wikispaces.com/SoftwareSerialRS485Example

Im trying to send a Analog value from Arduino A to arduino B. Its 100metres of Cat cable between the two.

You should try to digitize the analog value, then send the digital representation over the wire to the other arduino.

Funkafett:
Im trying to send a Analog value from Arduino A to arduino B. Its 100metres of Cat cable between the two.
Currently im just doing a analogWrite(6, 100); on my Arduino A, and analogRead(15); on my Arduino B.

Just send the number 100 to the other Arduino (Serial.println(100); ) and let it do the analogWrite() part.

You may find some useful ideas in Serial Input Basics

...R