|
このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。 |
Where's the remote 支配(する)/統制する for the TV? If you can find it, wouldn't it be 冷静な/正味の if it could be used to send 命令(する)s to your Arduino? Read on....
You buy a TSOP1838 部隊... I got 地雷 from nuelectronics.com for about $3, 加える modest p&p, 7/10. It needs three 関係s: 5v, gnd and a 数字表示式の input. As I had a nuelectronics datalogging 保護物,者, I 簡単に plugged it in to one of the 保護物,者's connectors. If you don't have the 保護物,者, plugging in will still be no hassle unless you are very new to Arduinos. Even then, if you can't do it easily, you need to learn those 技術s! (You can take the 5v from the Arduino.)
ARGH!!! 複雑化s on 複雑化s!
Here's as much as I can get to the 底(に届く) of this morning...
Once Upon A Time, things just worked.
Then さまざまな people changed things, and there were unintended consequences.
Just now, 15 損なう 15, I got the に引き続いて "working" again. I'm using Arduino 1.0.6 on a Windows 7 PC, and define "working" only as far as "will 収集する". (I 港/避難所't dug out the 金物類/武器類 to 実験(する) that it really 作品. I'd be 感謝する to anyone who can do that who would 令状 and tell me.
I downloaded and 任命する/導入するd the 現在の "best" "IRremote" library from Shirriff... 見解/翻訳/版 1.0, によれば "Readme.md", which can be opened by an ordinary text editor, who knows why he didn't call it Readme.txt. Bah.
When I tried to 収集する my code, there was an error 伴う/関わるing 'TKD2'.
A bit of digging leads to....
... but you don't have to read that, if you want to take my word for the に引き続いて.
If you "break" something else, you "直す/買収する,八百長をする" IRremote. My code 収集するs without errors. The examples I've tried, from those 供給(する)d with IRremote, 収集する. (Which they didn't... TKD2 errors... before the に引き続いて...)
(Shut 負かす/撃墜する any open Ardiuno 開会/開廷/会期s you may have open at this point.)
In your Arduino Libraries folder, I think you will find one called RobotIRremote. 改名する it. I 簡単に stuck my 初期のs, "TKB", の上に the end of it, as they don't seem to 刈る up from outside sources on my computer. (If I were 指名するd Michael Smith, I might have to use a different approach.)
By doing that, you "break" the RobotIRremote library, to a degree, but in a 平易な spotted way. Happily, in my 事例/患者, I don't think I am using this library. If the day comes that I want to, I can "undo" my breaking easily, and as the "損失d" RobotIRremote library is still more or いっそう少なく where it was before, I might even be able to find the bit I broke. Sigh.
So. Imperfect. Unsatisfactory. But should, up to a point, "work". And maybe, in 予定 course, the problems 原因(となる)d by others will be 解決するd, and we can move 今後 to a world where we can use BOTH IRremote and RobotIRremote... withouth all this hassle.
*** * * * ...End of Stop 圧力(をかける)
You 任命する/導入する the IRremote library into your Arduino 開発 system. That comes from Ken Shirriff's blog, "arcfn" link below , and I've done a tutorial on ソフトウェア libraries if you don't already know about them. (If you do know about libraries, skip my tutorial. Ken's library is "井戸/弁護士席 behaved", no special "features" (hassles).)
For IRremote from Ken Shirriff: http://www.arcfn.com/2009/08/multi-議定書-infrared-remote-library.html
aka...
After the library is 任命する/導入するd, you enter the に引き続いて into your Arduino...
/*
* IRremote: IRrecvDemo - 論証するs receiving
* IR codes with IRrecv
* An IR detector/demodulator must be connected
* to the input RECV_PIN.
* 見解/翻訳/版 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* http://arcfn.com
*/
#含む <IRremote.h>
int RECV_PIN = 14;//SEE NOTE in Sheepdogguides text
//Must be 始める,決める to the Arduino pin your sensor is on.
//http://sheepdogguides.com/arduino/ar3ne1ir.htm
IRrecv irrecv(RECV_PIN);
decode_results results;
無効の 体制/機構()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
無効の 宙返り飛行() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.再開する(); // Receive the next value
}
}
(自白: That code hasn't been DIRECTLY 実験(する)d... it is a copy from where I got the code I DID 実験(する)... let me know if you have any problems... after you've dealt with the RECV_PIN= line)
You may need to change the number in....
int RECV_PIN = 14;
The "権利" number depends on where you plugged your sensor into your Arduino. If you are using the nuelectronics 保護物,者, 14 is 権利 for P4. (See 指名するing of Parts if you don't know which connector is P4. It is 示すd... in tiny 令状ing... on the 保護物,者.) Never heard of a 数字表示式の line with such a high number? It is just another 指名する for the analog I/O line "0". You can use one of the "ordinary" 数字表示式の I/O lines if you are more comfortable with that.
Run the program. Once it has uploaded to your Arduino, run the serial 監視する. Point a remote 支配(する)/統制する at the sensor, 存在 careful that whatever it 普通は 支配(する)/統制するs can't "see" it, if you want to stay sane, and 圧力(をかける) a button. You should see some characters appear on the serial 監視する!
That little program, by the way, uses 6150 bytes of memory, because of the things pulled in by the #含む. I 追加するd a tiny bit of code which would 原因(となる) the altered program to do what it did before and send signals out with an IR LED, and the program size only grew to 6726 bytes. While elements of the "receive IR signals" and the "send IR signals" code will be 株d, you do seem to be "支払う/賃金ing for" the "send IR" code, even when you aren't using it. Small price, for this elegant library. Do not underestimate the work that you are 存在 saved. Different companies use different ways of encoding their data, for one thing.
I've 首尾よく used the system above with....
If I 圧力(をかける) the "1" on my Sony 無線で通信する remote, I get "26" from the system above. If I 圧力(をかける) "2" on the same 監査役, I get "4026"
In the first instance, a 選び出す/独身 byte has been sent. In the second, a two byte message was sent.
When I use a different 監査役, I get different... but 一貫した... results.
I wouldn't encourage you to try to see the method (if any) in the madness of the encoding systems used. I would 簡単に use matching to "see" 命令(する)s of 利益/興味. Here's how you do that...
First run the simple デモ above to find out what your remote sends. For a simple デモ of 答える/応じるing to a 明確な/細部 code, you can 追加する the に引き続いて two lines just after the " Serial.println(results.value, HEX); " line....
if (results.value==0x26){Serial.println("Sony 無線で通信する 1");};
if (results.value==0x4026){Serial.println("Sony 無線で通信する 2");};
(Again... I 港/避難所't 実験(する)d that... copied it, by 手渡す(!), from the 審査する of an 隣接する computer. 陳謝s for any typos... PLEASE WRITE ME with any 是正s!) (In fact an "it worked" email would be welcome, or a StumbleUpon 投票(する)? (See link at 最高の,を越す of page.))
N.B. Unless you are also using a 監査役 that 放出するs "26" and "4026" when you 圧力(をかける) the "1" and "2" buttons, you will need to change the code you are trying to match.
The code will always have a "0x" (that's "無 ex") in 前線 of it to say that it is 表明するd in hex. As hex, the codes can 含む/封じ込める the letters A-F 同様に as the digits 0-9, by the way.
Bad news? It could be that the library is "messing with" the timers and/ or interrupts in your Arduino... but that may be NECESSARY for any decent IR reader. I 港/避難所't 熟考する/考慮するd Ken Shirriff's page carefully... I bet he explains any such "messing" there. It isn't likely to be a problem for people getting started with using IR 監査役s as "keyboards" for Arduinos... but it is a possible cloud on the horizon for 前進するd 使用者s. But, as I said, probably a necessary "cloud"... and one that you will be able to manage, if you are 前進するd enough to be doing things to the default timer and interrupt settings.
Good news! While the 焦点(を合わせる) of this page is reading signals from IR 監査役s, as I sort of について言及するd a while 支援する, the library has other 能力s. In particular, it makes it 平易な for you to send the codes sent by IR 監査役s. You only need an IR LED (and the 現在の 限界ing resistor used with all LEDs)
I have in mind to build a "challenge/ 返答" 接近 監査役 using two Arduinos, and Ken's library gives me what I need. In 簡単にするd essence: An Arduino inside my house, by a window by the 前線 door will look for a burst of IR from a portable "重要な" Arduino with an IR transmitter (and receiver). The inside Arduino will then send a 無作為の number to the outside Arduino. The outside Arduino will then 二塁打 the number it was sent, and send that 支援する. If the inside Arduino sees that 二塁打d number coming 支援する, it opens the door. (明白に(?) the 支配するs of what will be sent, and what will 構成する a 訂正する reply will be more arcane.)
By all means work that up yourself if you have time before I do. If I 奮起させるd or helped you (the idea isn't ground-breaking!) I'd welcome a link to my pages from your pages... and I'd be pleased to hear of your 事業/計画(する)'s 完成!
I remember "broken light beam" 夜盗,押し込み強盗, etc, detectors from "the days of my 青年" (don't ask... before 統合するd 回路・連盟s for hobbyists, anyway, although transistors had made it out of the 研究 labs!)... so why use an Arduino for something so 歩行者?
That little TSOP1838 部隊 is far more clever than you may have realized. It doesn't just look for some IR light. It looks for IR light "blinking" at a 明確な/細部 frequency... a very high frequency.
If you 絶えず "wink" an IR LED at the 権利 frequency, and have it 向こうずね on a TSOP1838, then the (数字表示式の... i.e. 強健な) 生産(高) of the TSOP1838 will change if the light from the LED is 封鎖するd.
Same idea as the "break the beam" sensors of my 青年, but a more reliable system in which the detector is harder to 混乱させる with 逸脱する other sources of infra red light... 含むing things like the muffler of a car. Ken has more on this in a page on his 場所/位置.
Which brings me to another Arduino 事業/計画(する) for you: A clever camera 罠(にかける).
Basic idea: When light beam is broken, picture is taken.
Clever bit: Use TWO light beams, making an "X" in a 水平の 計画(する). Take picture ONLY when BOTH beams are broken. Now you get the picture of the passing BigFoot when it is in an optimal 位置/汚点/見つけ出す, and your camera isn't tripped when the 支配する is at inconvenient 位置/汚点/見つけ出すs along a 選び出す/独身 beam. (Not my idea, and, sorry, I forget where I saw it first.)
Of course, while not so much fun, not so "clever", a simple Sharp reflective proximity detector might be just as 効果的な, and a lot いっそう少なく fussy to 始める,決める up. "Break the beam" detectors are better than the Sharp for 監視するing many points on a long line... more or いっそう少なく the opposite of what you want in the "camera 罠(にかける)" 誘発する/引き起こす sensor. Sigh. If you decide to play with camera 罠(にかける)s, remember you will have to over-ride your camera's sleep- and- save- the- 殴打/砲列 機能(する)/行事.
So? What are you waiting for? If you have read this far, you 明白に liked the page. While I'd really like it if you tried my Windows freeware and sent feedback, I know you're not likely to do that, but could you at least click the "StumbleUpon" button at the 最高の,を越す of the page??? And maybe work up a 事業/計画(する) using the IR sensor/ LED (警察などへの)密告,告訴(状) here, one of "my" 事業/計画(する)s, even, and 地位,任命する a "how to" for others? (With a link 支援する to my page??) The Arduino playground makes publishing 平易な! And the Arduino 会議 is 価値(がある) supporting too... please, though: search for old 地位,任命するs before asking, for instance, how to 支配(する)/統制する a モーター?
-------------------
その上の to the Arduino ideas the page you are reading now will take you to, I have 地位,任命するd a 一連の essays which try to help you become a better Arduino programmer and engineer... but, for the best result, you will have to buckle 負かす/撃墜する and work your way through them in sequence. The "How To's" here can be 接近d in whatever order you like.
Feel 解放する/自由な to use this (警察などへの)密告,告訴(状) in programming courses, etc, but a credit of the source would be 高く評価する/(相場などが)上がるd. If you 簡単に copy the pages to other web pages you will do your readers a disservice: Your copies won't stay 現在の. Far better to link to these pages, and then your readers see up-to-date 見解/翻訳/版s. For those who care- thank you- I have 地位,任命するd a page with more (警察などへの)密告,告訴(状) on what copyright 権利放棄s I 延長する, and suggestions for those who wish to put this 構成要素 on CDs, etc.
See the discussion 近づく the 底(に届く) of the "最高の,を越す level" page covering the 本体,大部分/ばら積みの of my Arduino 出資/貢献s. There is (警察などへの)密告,告訴(状) there, too, about things like "May I copy your 構成要素?", and the system of とじ込み/提出する 指名するs I am trying to work to.
If you visit 1&1's 場所/位置 from here, it helps me. They host my website, and I wouldn't put this link up for them if I wasn't happy with their service... although I was いっそう少なく than pleased the other day to have what I was doing interrupted by a telephone call from their sales team, trying to get me to 延長する my 関与. Sigh. Hardly a rare event, but I'd thought 1&1 were a bit classier that some of the people who have my telephone number.
Click here to visit editor's Sheepdog ソフトウェア (tm) freeware, shareware pages.
Click here to visit the homepage of my biggest 場所/位置.
Click here to visit the homepage of Sheepdogsoftware.co.uk. 陳謝s if the "?Frmar3ne1ir" I 追加するd to that link 原因(となる)s your browser problems. Please let me know, if so?
Page 実験(する)d for 同意/服従 with INDUSTRY (not MS-only) 基準s, using the 解放する/自由な, 公然と accessible validator at validator.w3.org
....... P a g e . . . E n d s .....