Go Down

Topic: Problem reading analog values (Read 480 times) previous topic - next topic

newari

Hello i been trying to make a wireless  communication with ir, the only problem is that the value it gets from the ir receiver is pretty much wrong.

i have putting up two sketch, the one only reading values are getting around 900 when the ir led is on and my one is getting only around 180 even if the led is on or off;S?????

joe mcd

Normally IR communication does not use analog input which is slow. 
What are you trying to achieve? 
You can use well proven solutions involving the PNA4602 and similar IR receivers.

For example I have good results with these: 
http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html (Ken Shirriff)
https://github.com/shirriff/Arduino-IRremote
http://learn.adafruit.com/ir-sensor
http://www.adafruit.com/products/389  (mini remote control)



newari

I'm trying to make a communication that allows  streaming files on on wireless IR.

I have done BMC coding, (Bi phase mark coding), the sketch was for the receiver part,
http://en.wikipedia.org/wiki/Differential_Manchester_encoding

I actualy fixed the issue and the next issue is converting the bits i get to into a single byte variable( dont know how to decribe the issue)
Let's say iam sending a 8 bits , 1111 1111 and when iam receving the bits how do i make it into a byte?
ex
byte x= b0000 0000;
byte x= x+bits_rec[z];  z is between 0 and 7
is this possible?

joe mcd

Thanks for the reference to Manchester encoding.  I used it many years ago but had forgotten.

Combining bits is no problem.  Bit operations are built in to the C language.  Arduino is just a thin layer on top and supports the bit shift operators  <<  and >>.

This tutorial should help:
http://playground.arduino.cc/Code/BitMath


Go Up