Pages: [1]   Go Down
Author Topic: Problem reading analog values  (Read 450 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?????

* mottagare.ino (2.25 KB - downloaded 9 times.)
* sketch_apr30b.ino (0.14 KB - downloaded 8 times.)
Logged

0
Offline Offline
Sr. Member
****
Karma: 8
Posts: 394
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)


Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Offline Offline
Sr. Member
****
Karma: 8
Posts: 394
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Pages: [1]   Go Up
Jump to: