{"id":6826,"date":"2018-07-31T15:37:54","date_gmt":"2018-07-31T06:37:54","guid":{"rendered":"https:\/\/techclass.wfjydl.com\/?p=6826"},"modified":"2022-03-28T14:08:28","modified_gmt":"2022-03-28T06:08:28","slug":"%e5%88%a9%e7%94%a8rohm%e4%bc%a0%e6%84%9f%e5%99%a8%e8%af%84%e4%bc%b0%e5%a5%97%e4%bb%b6%e5%ae%9e%e7%8e%b0ucla-airmouse-%e7%ac%ac2%e9%83%a8%e5%88%86","status":"publish","type":"post","link":"https:\/\/techclass.wfjydl.com\/knowledge\/deviceplus\/connect\/ucla-airmouse-using-rohm-sensor-evaluation-kit-part-2","title":{"rendered":"\u5229\u7528极悦娱乐\u4f20\u611f\u5668\u8bc4\u4f30\u5957\u4ef6\u5b9e\u73b0UCLA AirMouse \u2013 \u7b2c2\u90e8\u5206"},"content":{"rendered":"<p><script type=\"text\/javascript\" src=\"https:\/\/ssl-cache.stream.ne.jp\/www50\/eqa194obdo\/jmc_pub\/jmc_swf\/player\/t3\/if.js\" charset=\"UTF-8\"><\/script><\/p>\n<div class=\u201cthe_content_wrapper\u201d>\n\u8fd9\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e<a href=\"https:\/\/www.deviceplus.com\/\">DevicePlus.com<\/a>\u82f1\u8bed\u7f51\u7ad9\u7684\u7ffb\u8bd1\u7a3f\u3002<\/p>\n<p><a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/deviceplus\/connect\/ucla-airmouse-using-rohm-sensor-evaluation-kit-part-1\"><strong>\u70b9\u51fb\u6b64\u5904\u9605\u8bfb\u672c\u6587\u7684\u7b2c1\u90e8\u5206 &gt;<\/strong><\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5780\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/05\/image001-1.jpg\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/05\/image001-1.jpg 700w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/05\/image001-1-300x225.jpg 300w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/05\/image001-1-195x146.jpg 195w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/05\/image001-1-50x37.jpg 50w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/05\/image001-1-100x75.jpg 100w\" alt=\"3d airmouse\" width=\"700\" height=\"524\" \/><\/p>\n<p><script type=\"text\/javascript\">\n\tjstream_t3.PlayerFactoryIF.create({\n\tb:\"eqa194obdo.eq.webcdn.stream.ne.jp\/www50\/eqa194obdo\/jmc_pub\/jmc_swf\/player\/\",\n\tc:\"NDc3\",\n\tm:\"Mzk2\",\n\ts:{\n\t\thp:360,\n\t\til:\"off\",\n\t\trb:\"off\",\n\t\tsn:\"f,t,g\",\n\t\twp:640\n\t}});\n<\/script><\/p>\n<p>\u5728<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/deviceplus\/connect\/ucla-airmouse-using-rohm-sensor-evaluation-kit-part-1\" target=\"_blank\" rel=\"noopener noreferrer\">\u5229\u7528极悦娱乐\u4f20\u611f\u5668\u8bc4\u4f30\u5957\u4ef6\u5b9e\u73b0UCLA AirMouse \u2013 \u7b2c1\u90e8\u5206<\/a>\u4e2d\uff0c\u6211\u4eec\u5b8c\u6210\u4e86\u9879\u76ee\u7684\u786c\u4ef6\u3002\u5bf9\u4e8e\u53d1\u5c04\u5668\u90e8\u5206\uff0c\u6211\u4eec\u5c06AirMouse\u6309\u94ae\u4ee5\u53caUno\u7684GPIO\u5f15\u811a\u548cRF\u6a21\u5757\u4e4b\u95f4\u7684\u63a5\u53e3\u7ec4\u88c5\u5728\u4e00\u5757\u9762\u5305\u677f\u4e0a\u3002\u7531\u4e8e极悦娱乐\u4f20\u611f\u5668\u5f00\u53d1\u677f\uff08SensorShield\uff09\u5728\u539f\u578b\u8bbe\u8ba1\u548cDIY\u9879\u76ee\u65b9\u9762\u7684\u5e94\u7528\u975e\u5e38\u65b9\u4fbf\uff0c\u56e0\u6b64\u6211\u4eec\u9009\u62e9\u5c06\u5176\u4e0e\u52a0\u901f\u5ea6\u8ba1\u6a21\u5757\u63a5\u5408\u5728\u4e00\u8d77\u4f7f\u7528\u3002\u6b63\u5982\u60a8\u5c06\u5728\u672c\u6559\u7a0b\u4e2d\u770b\u5230\u7684\u90a3\u6837\uff0c极悦娱乐\u5f00\u53d1\u677f\u5185\u7f6eArduino\u4e0e\u5176\u5916\u8bbe\u4e4b\u95f4\u7684I2C\u901a\u4fe1\u529f\u80fd\uff0c\u56e0\u6b64\uff0c\u7528\u6237\u901a\u8fc7\u4e00\u4e9b\u7b80\u5355\u4ee3\u7801\u5c31\u53ef\u4ee5\u63a5\u6536\u52a0\u901f\u5ea6\u8ba1\u7684\u6570\u636e\uff0c\u65e0\u9700\u7f16\u5199\u4efb\u4f55\u5e95\u5c42I2C\u51fd\u6570\u6765\u53d1\u9001\u548c\u63a5\u6536\u6765\u81ea\u8bbe\u5907\u5730\u5740\u7684\u6570\u636e\u3002\u5bf9\u4e8e\u63a5\u6536\u5668\u90e8\u5206\uff0c\u6211\u4eec\u4e3aTeensy\u5fae\u63a7\u5236\u5668\u7ec4\u88c5\u4e86\u7c7b\u4f3c\u7684\u5206\u7ebf\u677f\uff0c\u4ee5\u4fbf\u4e0eRF\u6a21\u5757\u5bf9\u63a5\u3002<\/p>\n<p>\u672c\u6559\u7a0b\u4ecb\u7ecd\u548c\u63cf\u8ff0\u7684\u4ee3\u7801\u5c06\u5e2e\u60a8\u5c06\u4e24\u4e2a\u6a21\u5757\u8fde\u63a5\u5728\u4e00\u8d77\uff0c\u4ee5\u5b8c\u6210\u8be5\u9879\u76ee\u3002\u6211\u4eec\u5c06\u5411\u60a8\u5c55\u793a\u4e24\u4e2a\u6a21\u5757\u4e4b\u95f4\u53d1\u9001\u6570\u636e\u7684\u57fa\u672c\u4ee3\u7801\u4ee5\u53ca\u5904\u7406\u52a0\u901f\u5ea6\u8ba1\u6570\u636e\u4ee5\u5728\u8ba1\u7b97\u673a\u663e\u793a\u5668\u4e0a\u79fb\u52a8\u5149\u6807\u7684\u57fa\u672c\u4ee3\u7801\u3002\u540c\u65f6\uff0c\u6211\u4eec\u5e0c\u671b\u60a8\u80fd\u521b\u9020\u4e00\u4e9b\u66f4\u9177\u7684\u8865\u5145\u548c\u6539\u8fdb\uff01<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>AirMouse\u5feb\u901f\u6982\u89c8<\/strong><\/h2>\n<p>\u6211\u4eec\u90fd\u7528\u8fc7\u7535\u8111\u9f20\u6807\uff0c\u4f46\u662f\u5b83\u4eec\u53ea\u80fd\u5728\u684c\u9762\u4e4b\u7c7b\u7684\u5e73\u9762\u4e0a\u5de5\u4f5c\u3002\u6211\u4eec\u5df2\u7ecf\u5236\u4f5c\u4e86\u4e00\u4e2a\u201cAirMouse\u201d\u2014\u2014\u4e00\u6b3e\u80fd\u591f\u57283D\u7a7a\u95f4\u4e2d\u8fd0\u884c\u7684\u8ba1\u7b97\u673a\u9f20\u6807\u3002\u7528\u6237\u901a\u8fc7\u503e\u659c\u9f20\u6807\u5c31\u53ef\u4ee5\u8ba9\u5c4f\u5e55\u4e0a\u7684\u5149\u6807\u79fb\u52a8\uff0c\u4ece\u800c\u53ef\u4ee5\u8fdb\u884c\u5927\u8303\u56f4\u81ea\u5b9a\u4e49\u52a8\u4f5c\u3002\u6211\u4eec\u5df2\u7ecf\u5728\u7b2c1\u90e8\u5206\u4e2d\u4ecb\u7ecd\u4e86\u6784\u5efaAirMouse\u7684\u57fa\u7840\u77e5\u8bc6\u3002AirMouse\u4e3b\u8981\u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff1a\u6234\u5728\u624b\u4e0a\u7684\u9f20\u6807\u53d1\u5c04\u5668\u548c\u8fde\u63a5\u7528\u6237\u8ba1\u7b97\u673a\u7684\u63a5\u6536\u5668\u3002\u53d1\u5c04\u5668\u6536\u96c6\u9f20\u6807\u7684\u65b9\u5411\u548c\u6309\u94ae\u72b6\u6001\u4fe1\u606f\uff1b\u800c\u63a5\u6536\u5668\u5219\u8d1f\u8d23\u8f6c\u6362\u8fd9\u4e9b\u4fe1\u606f\uff0c\u4ece\u800c\u5728\u8ba1\u7b97\u673a\u5c4f\u5e55\u4e0a\u6267\u884c\u76f8\u5e94\u64cd\u4f5c\u3002AirMouse\u7531Arduino Uno\u548cnRF24L01\u5c04\u9891\u6a21\u5757\u7ed3\u5408极悦娱乐\u4f20\u611f\u5668\u5f00\u53d1\u677f\u7684\u52a0\u901f\u5ea6\u8ba1\u6784\u5efa\u800c\u6210\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>\u7b2c1\u90e8\u5206\u7684\u786c\u4ef6\uff1a<\/strong><\/h2>\n<p><strong>\u53d1\u5c04\u5668\uff1a<\/strong><\/p>\n<ul>\n<li>\u25cf 1 x Arduino Uno\u5fae\u63a7\u5236\u5668<\/li>\n<li>1 x <a href=\"https:\/\/www.wfjydl.com\/sensor-shield-support\/shield\">极悦娱乐\u4f20\u611f\u5668\u8bc4\u4f30\u5957\u4ef6<\/a><\/li>\n<li>1 x <a href=\"https:\/\/www.wfjydl.com\/sensor-shield-support\/accelerometer\">极悦娱乐\u52a0\u901f\u5ea6\u8ba1 (<\/a><a href=\"https:\/\/www.wfjydl.com\/sensor-shield-support\/accelerometer\">KX022-1020<\/a><a href=\"https:\/\/www.wfjydl.com\/sensor-shield-support\/accelerometer\">)<\/a><\/li>\n<li>1 x nRF24L01+ RF\u6a21\u5757<\/li>\n<li>\u6392\u6bcd<\/li>\n<li>\u6ed1\u52a8\u5f00\u5173<\/li>\n<li>1 x \u53ef\u710a\u63a5\u8bd5\u9a8c\u7535\u8def\u677f\uff0c\u8db3\u591f\u5927\uff0c\u80fd\u710a\u63a5\u5fae\u63a7\u5236\u5668\u548c\u6240\u6709\u7535\u5b50\u5668\u4ef6<\/li>\n<li>2 x \u6309\u952e<\/li>\n<li>1 x 1s LiPo\u7535\u6c60<\/li>\n<li>1 x 1k\u2126\u7535\u963br<\/li>\n<li>1 x 3.3k\u2126\u7535\u963b<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>\u63a5\u6536\u5668\uff1a<\/strong><\/p>\n<ul>\n<li>1 x Teensy 3.2\u5fae\u63a7\u5236\u5668<\/li>\n<li>1 x NRF24L01+ RF\u6a21\u5757<\/li>\n<li>\u6392\u6bcd<\/li>\n<li>1 x \u53ef\u710a\u63a5\u8bd5\u9a8c\u7535\u8def\u677f\uff0c\u8db3\u591f\u5927\uff0c\u80fd\u710a\u63a5\u5fae\u63a7\u5236\u5668\u548c\u6240\u6709\u7535\u5b50\u5668\u4ef6<\/li>\n<li>1 x \u7ea2\u3001\u9ec4\u3001\u7effLED\u706f<\/li>\n<li>1 x 150\u2126\u7535\u963b<\/li>\n<\/ul>\n<p>\u6309\u7167\u7b2c1\u90e8\u5206\u8fde\u63a5\u786c\u4ef6\u4e4b\u540e\uff0c\u60a8\u5c31\u53ef\u4ee5\u5229\u7528\u4ee5\u4e0b\u7a0b\u5e8f\u8fd0\u884c\u53d1\u9001\u5668\u548c\u63a5\u6536\u5668\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>\u53d1\u5c04\u5668\uff1a<\/strong><\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-c\" data-lang=\"C\"><code>#include &lt;SPI.h&gt;\r\n#include \"RF24.h\"\r\n \r\n#define byte uint8_t\r\n#include &lt;Wire.h&gt;\r\n#include &lt;KX022.h&gt;\r\n \r\nKX022 accelerometer(KX022_DEVICE_ADDRESS_1E);\r\n \r\nRF24 radio(9,10);\r\n \r\nuint64_t pipes[2] = {0xF0F0F0F0F0, 0xF0F1F1F1F1}; \/\/reading, writing\r\n \r\nvoid initRadio()\r\n{\r\n radio.setPALevel(RF24_PA_HIGH);\r\n \/\/payload size default 32...\r\n radio.setChannel(10); \/\/you can change the channel setting\r\n radio.setCRCLength(RF24_CRC_16); \/\/2-byte CRC\r\n radio.setDataRate(RF24_1MBPS); \/\/1Mbps data rate\r\n \r\n radio.openReadingPipe(0, pipes[0]);\r\n radio.openWritingPipe(pipes[1]);\r\n}\r\n \r\n#define buttonPinR 2 \/\/change these accordingly\r\n#define buttonPinL 3\r\n \r\nvoid setup() {\r\n \/\/ put your setup code here, to run once:\r\n Serial.begin(9600);\r\n while (!Serial);\r\n \r\n pinMode(buttonPinR, INPUT);\r\n pinMode(buttonPinL, INPUT);\r\n \r\n radio.begin();\r\n initRadio();\r\n radio.stopListening();\r\n \r\n Wire.begin();\r\n accelerometer.init();\r\n}\r\n \r\nlong lastDebounceTimeR = 0;  \/\/ the last time the output pin was toggled\r\nlong lastDebounceTimeL = 0;\r\nlong debounceDelay = 50;\r\nint buttonStateR = LOW;             \/\/ the current reading from the input pin\r\nint buttonStateL = LOW;\r\nint lastReadingR = LOW;\r\nint lastReadingL = LOW;\r\n \r\nchar readButtonR(){\r\n int reading = digitalRead(buttonPinR);\/\/get what state the button is\r\n char out = 'a';\/\/the value to return if nothing special happened\r\n \r\n if (reading != lastReadingR) {\/\/We're reading a new state for button\r\n   \/\/ reset the debouncing timer\r\n   lastDebounceTimeR = millis();\r\n }\r\n \r\n if ((millis() - lastDebounceTimeR) &gt; debounceDelay) {\/\/We finally have a stable value\r\n   if (reading != buttonStateR)\/\/Compared to our previous state, we have a flip\r\n   {\r\n     out = 'r';\/\/prepare to toggle the Mini\r\n   }\r\n   buttonStateR = reading;\/\/Make the buttonState the same\r\n }\r\n \r\n lastReadingR = reading;\/\/make the last state the \"current\" state\r\n return out;\r\n}\r\n \r\nchar readButtonL(){\r\n int reading = digitalRead(buttonPinL);\r\n char out = 'a';\r\n \r\n if (reading != lastReadingL) {\r\n   \/\/ reset the debouncing timer\r\n   lastDebounceTimeL = millis();\r\n }\r\n \r\n if ((millis() - lastDebounceTimeL) &gt; debounceDelay) {\r\n   \r\n   if (reading != buttonStateL)\r\n   {\r\n     out = 'l';\r\n   }\r\n   buttonStateL = reading;\r\n }\r\n \r\n lastReadingL = reading;\r\n return out;\r\n}\r\n \r\nstruct data\r\n{\r\n boolean isPushedR = false;\r\n boolean isPushedL = false;\r\n int8_t acceleration[3] = {0, 0, 0};\r\n};\r\n \r\ndata packet;\r\nboolean rState = false;\/\/these states are used to represent the current state of the buttons\r\nboolean lState = false;\r\n \r\nvoid loop() {    \r\n   \r\n   if(readButtonR() == 'r'){ \/\/toggle button state when button state change is detected\r\n     rState = !rState;\r\n   }\r\n   \r\n   if(readButtonL() == 'l'){ \/\/toggle button state when button state change is detected\r\n     lState=!lState;\r\n   }\r\n \r\n   packet.isPushedR = rState;\r\n   packet.isPushedL = lState;\r\n \r\n   uint8_t rc;\r\n   float acc[3];\r\n   rc = accelerometer.get_val(acc);\r\n   \r\n   if (rc == 0)\r\n   {\r\n     \/\/we cast to drop the decimal, we don't need that high precision \r\n     packet.acceleration[0] = (int8_t)(acc[0]*100); \/\/x\r\n     \/\/Serial.print(packet.acceleration[0]); Serial.print(\" \");\r\n     packet.acceleration[1] = (int8_t)(acc[1]*100); \/\/y\r\n     \/\/Serial.print(packet.acceleration[1]); Serial.print(\" \");\r\n     packet.acceleration[2] = (int8_t)(acc[2]*100); \/\/z\r\n     \/\/Serial.println(packet.acceleration[2]);\r\n   }\r\n \r\n   radio.write((char*) &amp;packet, sizeof(packet));\r\n}<\/code><\/pre>\n<\/div>\n<h2><strong>\u63a5\u6536\u5668\uff1a<\/strong><\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-c\" data-lang=\"C\"><code>#include &lt;SPI.h&gt;\r\n#include \"RF24.h\"\r\n \r\nRF24 radio(9,10);\r\n \r\nuint64_t pipes[2] = {0xF0F1F1F1F1, 0xF0F0F0F0F0}; \/\/reading, writing\r\n \r\nvoid initRadio()\r\n{\r\n radio.setPALevel(RF24_PA_HIGH);\r\n \/\/payload size default 32...\r\n radio.setChannel(10);\r\n radio.setCRCLength(RF24_CRC_16); \/\/2-byte CRC\r\n radio.setDataRate(RF24_1MBPS); \/\/1Mbps data rate\r\n \r\n radio.openReadingPipe(0, pipes[0]); \/\/reading pipe\r\n radio.openWritingPipe(pipes[1]);\r\n \r\n radio.startListening();\r\n \r\n}\r\n#define R_PIN 6 \/\/Red LED\r\n#define G_PIN 7 \/\/Green LED\r\n#define Y_PIN 8 \/\/Yellow LED\r\n \r\nvoid setup() {\r\n Serial.begin(9600);\r\n while(!Serial); \/\/wait until Serial is initialized...(we found that not including this line of code caused errors on the \r\n                 \/\/Teensy because it started executing code without ensuring that Serial communication with the laptop was\r\n                 \/\/properly initialized...\r\n radio.begin();\r\n initRadio();\r\n \r\n Mouse.screenSize(1920, 1080);  \/\/ configure screen size\r\n \r\n randomSeed(analogRead(0));\r\n \r\n pinMode(R_PIN, OUTPUT);\r\n pinMode(G_PIN, OUTPUT);\r\n pinMode(Y_PIN, OUTPUT);\r\n}\r\n \r\n#define CALIX 6 \/\/calibration for X\r\n#define CALIY -1 \/\/calibration for Y\r\n \r\n#define scalingFactor 0.05\r\n#define THRESHOLD 1\r\n \r\ndouble moveVector[2] = {0, 0};\r\n \r\nvoid tiltToVector(const int8_t* acceleration){\r\n moveVector[0] = 0;\r\n moveVector[1] = 0;\r\n if(abs(acceleration[0] - CALIX) &gt; THRESHOLD){ \/\/calculate move\r\n   moveVector[1] = (double)(acceleration[0] * scalingFactor);\r\n }\r\n if(abs(acceleration[1] - CALIY) &gt; THRESHOLD) {\r\n   moveVector[0] = (double)(acceleration[1] * scalingFactor);\r\n }\r\n}\r\n \r\nstruct data\r\n{\r\n boolean isPushedR = false;\r\n boolean isPushedL = false;\r\n int8_t acceleration[3] = {0, 0, 0};\r\n};\r\n \r\ndata packet;\r\n \r\nvoid loop() {\r\n \r\n bool stillWaiting = true;\r\n \/\/Serial.println(\"About to read\");\r\n   while(stillWaiting){\r\n     if(radio.available(0)){ \/\/You've got mail!!!\r\n       radio.read((char*) &amp;packet, sizeof(packet));\r\n       stillWaiting = false;\r\n     }\r\n   }\r\n \r\n Mouse.move(moveVector[0], moveVector[1]);\r\n Mouse.move(moveVector[0], moveVector[1]); \/\/call it twice within the loop for smoothness :) \r\n \r\n \/\/prints for debugging purposes\r\n Serial.println(\"Finished writing the pins\");\r\n if (packet.isPushedR) {\r\n   Serial.println(\"The right button has been clicked!!! (Did you mean to right click?!?!)\");\r\n }\r\n \r\n if (packet.isPushedL) {\r\n   Serial.println(\"The left button has been clicked!!! (Did you mean to left click?!?!)\");\r\n   \/\/Mouse.click();\r\n }\r\n \r\n Serial.print(\"X: \");\r\n Serial.println(packet.acceleration[0]);\r\n \r\n Serial.print(\"Y: \");\r\n Serial.println(packet.acceleration[1]);\r\n \r\n Serial.print(\"Z: \");\r\n Serial.println(packet.acceleration[2]);\r\n \r\n tiltToVector(packet.acceleration); \/\/re-calculate move vector coordinates\r\n \r\n \r\n\/\/  Mouse.move(moveVector[0], moveVector[1]);\r\n \r\n}<\/code><\/pre>\n<\/div>\n<p>\u5c06\u4ee3\u7801\u4e0a\u4f20\u5230Teensy\u4e0e\u5c06\u4ee3\u7801\u4e0a\u4f20\u5230Arduino Uno\u7565\u6709\u4e0d\u540c\u3002\u5bf9\u4e8eUno\uff0c\u60a8\u53ea\u9700\u6309\u7167\u901a\u5e38\u7684\u7f16\u8bd1\u548c\u4e0a\u4f20\u6b65\u9aa4\u6267\u884c\u5373\u53ef:<\/p>\n<ol>\n<li>\u4f9d\u6b21\u9009\u62e9Tools &gt; Board &gt; Arduino\/Genuino Uno<\/li>\n<li>\u9009\u62e9\u7aef\u53e3\uff08Port\uff09<\/li>\n<li>\u70b9\u51fbArduino IDE\u4e2d\u7684\u201cUpload\u201d\uff08\u4e0a\u4f20\uff09\u6309\u94ae<\/li>\n<\/ol>\n<p>\u800c\u5bf9\u4e8eTeensy\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u4e0a\u4f20\u63a5\u6536\u5668\u4ee3\u7801:<\/p>\n<ol>\n<li>\u4f9d\u6b21\u9009\u62e9Tools &gt; Board &gt; Teensy 3.2 \/ 3.1<\/li>\n<li>\u4f9d\u6b21\u9009\u62e9Tools &gt; USB Type &gt; Keyboard + Mouse + Joystick \uff08\u6211\u4eec\u5c06Teensy\u5f53\u4f5c\u4e00\u4e2aUSB\u8bbe\u5907\u4f7f\u7528\uff09<\/li>\n<li>\u70b9\u51fbArduino IDE\u4e2d\u7684\u201cUpload\u201d\uff08\u4e0a\u4f20\uff09\u6309\u94ae<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>\u4e3a\u4e86\u672c\u6559\u7a0b\u7684\u76ee\u7684\uff0c\u6211\u4eec\u4e0d\u4f1a\u8be6\u7ec6\u6d89\u53ca\u6240\u4f7f\u7528\u7684\u4e0d\u540c\u901a\u4fe1\u534f\u8bae\uff0c\u4e5f\u4e0d\u4f1a\u8be6\u7ec6\u4ecb\u7ecdRF\u6a21\u5757\u7684\u901a\u4fe1\u8f6f\u4ef6\u3002\u8981\u4e86\u89e3\u6709\u5173\u8fd9\u4e9b\u4e3b\u9898\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u67e5\u770b\u6211\u4eec\u7684 <strong><a href=\"https:\/\/www.deviceplus.com\/how-tos\/arduino-guide\/arduino-communication-protocols-tutorial\/\">\u901a\u4fe1\u534f\u8bae<\/a> \u548c <a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/deviceplus\/how-tos\/arduino\/6905\">nRF24L01+ \u6a21\u5757<\/a> \u6559\u7a0b<\/strong> \u76f8\u53cd\uff0c\u6211\u4eec\u5c06\u7b80\u8981\u4ecb\u7ecd\u8f6f\u4ef6\u4e2d\u4e3b\u63a7\u5236\u7535\u8def\u7684\u5de5\u4f5c\u539f\u7406\u3002<\/p>\n<p>\u5728AirMouse\u4e2d\uff0c\u53d1\u5c04\u5668\u8d1f\u8d23\u6536\u96c6\u6570\u636e\uff0c\u4f46\u5927\u90e8\u5206\u6570\u636e\u5904\u7406\u7531\u63a5\u6536\u5668\u6a21\u5757\u8fdb\u884c\u3002\u7cfb\u7edf\u7684\u8fd9\u79cd\u8bbe\u8ba1\u65b9\u5f0f\u4f7f\u5f97Arduino\u2014\u2014\u6bd4Teensy\u66f4\u5f31\u7684\u5904\u7406\u5668\u2014\u2014\u53ea\u9700\u8981\u6536\u96c6\u6570\u636e\u5373\u53ef\uff0c\u56e0\u6b64\u80fd\u591f\u5728\u51b3\u7b56\u548c\u8ba1\u7b97\u4e0a\u82b1\u8d39\u66f4\u5c11\u7684\u8d44\u6e90\uff0c\u5e76\u80fd\u591f\u4ee5\u66f4\u5feb\u7684\u5468\u671f\u8fd0\u884c\u3002\u901a\u8fc7\u8fd9\u79cd\u5b9e\u73b0\u65b9\u6cd5\uff0c\u4e24\u53f0\u8bbe\u5907\u4e4b\u95f4\u552f\u4e00\u53d1\u9001\u7684\u6570\u636e\u5c31\u662f\u539f\u59cb\u52a0\u901f\u8ba1\u6570\u636e\u548c\u6309\u94ae\u6570\u636e\u3002Teensy\u63a5\u6536\u8fd9\u4e9b\u539f\u59cb\u6570\u636e\u5e76\u8fdb\u884c\u5904\u7406\uff0c\u4ece\u800c\u5728\u8ba1\u7b97\u673a\u5c4f\u5e55\u4e0a\u6267\u884c\u76f8\u5e94\u64cd\u4f5c\u3002<\/p>\n<p>\u4e3a\u4e86\u68c0\u6d4bAirMouse\u7684\u65b9\u4f4d\uff0c\u7cfb\u7edf\u5fc5\u987b\u80fd\u591f\u89e3\u6790\u539f\u59cb\u52a0\u901f\u8ba1\u6570\u636e\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b\u786e\u5b9a\u6bcf\u4e2a\u5750\u6807\u7684\u201c\u96f6\u503c\u201d\u3002\u96f6\u503c\u7684\u5b9a\u4e49\u5982\u4e0b\uff1aAirMouse\u4fdd\u6301\u5e73\u5766\uff08\u5e73\u884c\u4e8e\u5730\u9762\uff09\u65f6\u6bcf\u4e2a\u8f74\u7684\u52a0\u901f\u5ea6\u8ba1\u8f93\u51fa\u3002\u786e\u5b9a\u96f6\u503c\u540e\uff0c\u8f6f\u4ef6\u5c31\u80fd\u591f\u5c06\u52a0\u901f\u5ea6\u8ba1\u6570\u636e\u8f6c\u6362\u4e3a\u65b9\u5411\u548c\u6570\u91cf\uff0c\u901a\u8fc7\u5206\u6790\u6bcf\u4e2a\u8f74\u7684\u52a0\u901f\u5ea6\uff08\u7531\u4e8e\u91cd\u529b\uff09\u5e76\u5c06\u5176\u4e0e\u96f6\u503c\u8fdb\u884c\u6bd4\u8f83\u4ee5\u4fbf\u5728\u5c4f\u5e55\u4e0a\u79fb\u52a8\u5149\u6807\u3002<\/p>\n<p>\u73b0\u5728\uff0c\u6211\u4eec\u6765\u770b\u4e00\u4e0b\u63a5\u6536\u5668\u6a21\u5757\u4e0e\u7535\u8111\u4e4b\u95f4\u7684\u4ea4\u4e92\u3002Teensy\u88ab\u6307\u5b9a\u4e3aUSB\u4eba\u673a\u754c\u9762\u8bbe\u5907\uff08\u8fd9\u91cc\u662f\u6307USB\u9f20\u6807\uff09\u3002\u89e3\u6790\u65b9\u4f4d\u6570\u636e\u540e\uff0c\u8f6f\u4ef6\u4f1a\u8ba1\u7b97\u5149\u6807\u79fb\u52a8\u7684\u901f\u5ea6\u548c\u65b9\u5411\u3002\u6b64\u5916\uff0c\u8be5\u8f6f\u4ef6\u8fd8\u5c06\u70b9\u51fb\u5de6\u952e\u89e3\u6790\u4e3a\u5de6\u952e\u5355\u51fb\uff0c\u5c06\u70b9\u51fb\u53f3\u952e\u89e3\u6790\u4e3a\u53f3\u952e\u5355\u51fb\uff0c\u8c03\u7528\u9002\u5f53\u7684\u65b9\u6cd5\u5728\u8ba1\u7b97\u673a\u5c4f\u5e55\u4e0a\u663e\u793a\u5de6\u952e\u5355\u51fb\u6216\u53f3\u952e\u5355\u51fb\u529f\u80fd\u3002\u4ee5\u4e0b\u624d\u662f\u6700\u9177\u7684\u90e8\u5206\uff1a\u60a8\u5b8c\u5168\u53ef\u4ee5\u53ea\u901a\u8fc7\u8f6f\u4ef6\u5c31\u80fd\u591f\u4fee\u6539\u6216\u6dfb\u52a0\u9f20\u6807\u7684\u5c4f\u5e55\u529f\u80fd\uff01\u76ee\u524d\uff0c\u9f20\u6807\u53ea\u5177\u6709\u6700\u57fa\u672c\u7684\u529f\u80fd\u548c\u7279\u6027\uff0c\u4f46\u662f\u60a8\u53ea\u9700\u5bf9\u8f6f\u4ef6\u8fdb\u884c\u7b80\u5355\u6539\u52a8\uff0c\u5c31\u53ef\u4ee5\u8f7b\u677e\u6dfb\u52a0\u8bf8\u5982\u6eda\u52a8\u3001\u5c06\u5149\u6807\u79fb\u81f3\u5c4f\u5e55\u4e0a\u7684\u67d0\u4e2a\u70b9\u7b49\u529f\u80fd\uff01(<a href=\"https:\/\/www.pjrc.com\/teensy\/td_mouse.html\" target=\"_blank\" rel=\"noopener noreferrer\">\u8bf7\u70b9\u51fb\u6b64\u5904\uff0c\u4e86\u89e3Teensy USB\u9f20\u6807\u7684\u53c2\u8003\u6307\u5357<\/a>)\u00a0 \u4ee5\u4e0b\u662f\u60a8\u53ef\u4ee5\u5b9e\u73b0\u7684\u4e00\u4e9b\u5f88\u9177\u7684\u786c\u4ef6\u548c\u8f6f\u4ef6\u60f3\u6cd5:<\/p>\n<ul>\n<li>\u5c06\u4e0d\u540c\u6a21\u5f0f\u7684\u6309\u952e\u70b9\u51fb\u7528\u4f5c\u4e0d\u540c\u7684\u63a7\u5236\u529f\u80fd\uff08\u6bd4\u5982\uff0c\u53cc\u51fb\u53f3\u952e\u5173\u95ed\u7a97\u53e3)<\/li>\n<li>\u6dfb\u52a0\u6eda\u52a8\u529f\u80fd\uff01\uff08\u540c\u65f6\u70b9\u51fb\u4e24\u4e2a\u6309\u952e\u53d8\u4e3a\u201c\u6eda\u52a8\u6a21\u5f0f\u201d)<\/li>\n<li>\u6dfb\u52a0\u5176\u4ed6\u9f20\u6807\u6309\u952e\u4ee5\u6267\u884c\u6eda\u52a8\u64cd\u4f5c\u6216\u4e3a\u4e0d\u540c\u529f\u80fd\u83b7\u53d6\u66f4\u591a\u6309\u952e\u6a21\u5f0f<\/li>\n<\/ul>\n<p>\u6211\u4eec\u5e0c\u671b\u60a8\u80fd\u591f\u559c\u6b22\u8fd9\u4e2aAirMouse\u9879\u76ee\uff0c\u5e76\u4e14\u975e\u5e38\u671f\u5f85\u60a8\u53ef\u4ee5\u5bf9\u8bbe\u8ba1\u548c\u529f\u80fd\u8fdb\u884c\u4fee\u6539\u548c\u6539\u8fdb\uff01<\/p>\n<p>\u4f5c\u4e3aUCLA IEEE\u9ad8\u7ea7\u9879\u76ee\uff08Advanced Projects\uff09\u8ba1\u5212\u7684\u4e00\u90e8\u5206\uff0c\u6700\u521d\u7684AirMouse\u7531Rahul Iyer\u3001Aaron\u548cAndrew Wilhelm\u7814\u53d1\u3002\u66f4\u591a\u4fe1\u606f\u8bf7\u53c2\u9605 <a href=\"https:\/\/ieeebruins.org\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/ieeebruins.org<\/a><\/p>\n<p><strong>Device Plus\u6b63\u5728\u5bfb\u627e\u4e0e\u6d3b\u8dc3\u7684\u5b66\u751f\u5de5\u7a0b\u7ec4\u7ec7\u548c\u5b9e\u9a8c\u5ba4\u5c55\u5f00\u5408\u4f5c\u3002\u60f3\u4e86\u89e3\u6211\u4eec\u786c\u4ef6\u8d5e\u52a9\u8ba1\u5212\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u901a\u8fc7\u4ee5\u4e0b\u7535\u5b50\u90ae\u4ef6\u8054\u7cfb\u6211\u4eec\uff1ainfo@deviceplus.com<\/strong><\/p>\n<p><a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/deviceplus\/connect\/ucla-airmouse-using-rohm-sensor-evaluation-kit-part-1\"><strong>\u70b9\u51fb\u6b64\u5904\u9605\u8bfb\u672c\u6587\u7684\u7b2c1\u90e8\u5206<\/strong><\/a><\/p>\n<div class=\"author-box-wrapper\">\n<div class=\"avatar-wrapper\">\n\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/micro.wfjydl.com\/deviceplus\/wp-content\/uploads\/2019\/03\/Rahul-Iyer.png\" width=\"64\" height=\"64\" alt=\"DevicePlus \u7f16\u8f91\u56e2\u961f\">\n\t<\/div>\n<div class=\"desc-wrapper\">\n<h5>Rahul Iyer<\/h5>\n<div class=\"desc\">\n<p>Rahul\u662f\u52a0\u5dde\u5927\u5b66\u6d1b\u6749\u77f6\u5206\u6821\u7535\u6c14\u5de5\u7a0b\u5b66\u9662\u7684\u5b66\u751f\uff0c\u7231\u597d\u7535\u5b50\u548c\u673a\u5668\u4eba\u9879\u76ee\uff0c\u5c24\u5176\u70ed\u8877\u4e8e\u7535\u52a8\u6c7d\u8f66\u6280\u672f\u548c\u8f85\u52a9\u673a\u5668\u4eba\u6280\u672f\u3002<\/p>\n<\/div><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\u8fd9\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8eDevicePlus.com\u82f1\u8bed\u7f51\u7ad9\u7684\u7ffb\u8bd1\u7a3f\u3002 \u70b9\u51fb\u6b64\u5904\u9605\u8bfb\u672c\u6587\u7684\u7b2c1\u90e8\u5206 &gt; \u5728\u5229\u7528极悦娱乐\u4f20\u611f\u5668\u8bc4\u4f30\u5957\u4ef6\u5b9e\u73b0UCLA AirMouse \u2013 \u7b2c1\u90e8\u5206\u4e2d\uff0c\u6211\u4eec\u5b8c\u6210\u4e86\u9879\u76ee\u7684\u786c\u4ef6\u3002\u5bf9\u4e8e\u53d1\u5c04\u5668\u90e8\u5206\uff0c\u6211\u4eec\u5c06 [&hellip;]","protected":false},"author":3,"featured_media":18554,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1131],"tags":[],"class_list":["post-6826","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-connect"],"acf":[],"wps_subtitle":"","_links":{"self":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/6826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/comments?post=6826"}],"version-history":[{"count":10,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/6826\/revisions"}],"predecessor-version":[{"id":11532,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/6826\/revisions\/11532"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media\/18554"}],"wp:attachment":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media?parent=6826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/categories?post=6826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/tags?post=6826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}