arduino在编程过程中怎么把库函数添加到程序里面?还有怎么添加一些示例程序到自己编写的程序中? 请教如何在Arduino编程环境中配置OpenCV库
arduino\u5728\u7f16\u7a0b\u8fc7\u7a0b\u4e2d\u600e\u4e48\u628a\u5e93\u51fd\u6570\u6dfb\u52a0\u5230\u7a0b\u5e8f\u91cc\u9762\u4e24\u79cd\u65b9\u6cd5\uff1a \u5728Arduino IDE\u91cc\uff0c\u7b2c\u4e09\u4e2atab-Sketch\u4e0b\u9762-Import library-Add library,\u6307\u5b9a\u5230\u4f60\u7684XXX.zip\u5e93\u6587\u4ef6 \u89e3\u538b\u4f60\u7684zip\u6587\u4ef6\uff0c\u653e\u5230C:\Users\Administrator\Documents\Arduino\libraries\u91cc\u9762\u3002\uff08\u5bf9win7\u7528\u6237\uff0c\u5b9e\u9645\u4e0a\u5c31\u662fwindows\u7528\u6237-\u6211\u7684\u6587\u6863
\u7531\u4e8eOpenCV\u662f\u4e00\u4e2a\u56fe\u50cf\u5e93,\u56e0\u6b64\u5728VC++\u4e2d\u7f16\u7a0b\u4e4b\u524d\u9700\u8981\u9884\u5148\u8bbe\u7f6e\u7f16\u7a0b\u73af\u5883,\u5373\u5c06OpenCV\u9700\u8981\u7684\u4e00\u4e9b\u51fd\u6570\u5934\u6587\u4ef6\u548c\u5e93\u6587\u4ef6\u52a0\u5165\u5230\u5f53\u524d\u7f16\u8bd1\u7684\u5de5\u7a0b\u4e2d,\u4f7f\u5f97\u7a0b\u5e8f\u5728\u7f16\u8bd1
添加库文件 首先在程序-->导入库-->add library 把需要的库文件导入进来 然后在include直接 include 就可以,这个调用方式和c相同
绛旓細arduino缂栫▼璇█鍏ラ棬锛1. 鍏抽敭瀛 璇硶绗﹀彿锛;;鏄竴鏉¤鍙ョ粨鏉熺殑鏍囧織锛屼緵缂栬瘧鍣ㄨ瘑鍒紝蹇呴』寰楁湁銆倇} {}灏嗗鏉¤鍙ュ悎鎴愪竴涓鍚堣鍙ワ紝鑳藉垝鍒嗚鍙ョ殑浣滅敤鍩燂紝澧炲己鏁翠綋鏁翠綋鐨勫彲璇绘с// //琛屾敞閲婏紝璇ヨ//鍚庣殑鎵鏈夎鍙ワ紝鏂囧瓧灏嗕笉琚紪璇戝櫒鎵缂栬瘧銆佹墽琛屻傜浉浼肩殑锛岃繕鏈夛紝鍦ㄤ腑鐨勬墍鏈夎鍙ワ紝鏂囧瓧灏嗕笉琚紪璇戝櫒...
绛旓細浣犲彧闇瑕佹彁渚涗綘鎯宠寤惰繜鐨勬椂闂翠綔涓哄弬鏁般備緥濡傦紝`delayMicroseconds;` 灏嗗鑷Arduino鏆傚仠鎵ц涓嬩竴琛屼唬鐮佷竴姣銆傝繖鏍蜂綘灏卞彲浠ユ牴鎹渶瑕佹彃鍏ョ簿纭殑鏃堕棿寤惰繜銆傞渶瑕佹敞鎰忕殑鏄紝寰绾х殑寤惰繜涓嶉傜敤浜庨潪甯哥煭鏆傜殑鍝嶅簲锛屽洜涓鸿繖绉嶅欢杩熸槸绋嬪簭鎵ц杩囩▼涓鐨勯樆濉炴搷浣滐紝浼氭殏鍋滅▼搴忕殑鎵ц鐩村埌寤舵椂缁撴潫銆傚洜姝わ紝鍦ㄨ璁$▼搴忔椂锛屽簲璋ㄦ厧...
绛旓細鍒濆鍖)鍑芥暟涓轰笂鐢垫椂涓寮濮嬪氨鎵ц鐨勫嚱鏁般傜被浼肩數鑴戠殑寮鏈鸿嚜鍚姩绋嬪簭锛屾鍑芥暟浠呭湪涓婄數鏃惰鎵ц涓娆★紝姝ゅ悗姘镐笉鎵ц锛岄櫎闈為噸鍚3銆Arduino璇█鐨缂栫▼鏂瑰紡绫讳技浜嶤++锛屽寘鎷彉閲忋佹帶鍒剁粨鏋勩佸嚱鏁扮瓑鍩烘湰璇硶锛屽悓鏃惰繕鏈夎澶氬簱鍑芥暟鍙互鏂逛究鐢ㄦ埛杩涜鍚勭鎿嶄綔锛屽鎺у埗GPIO鍙c佽鍙栦紶鎰熷櫒鏁版嵁銆佽繘琛屼覆鍙i氳绛夈
绛旓細鑲畾闇瑕侊紝浣嗙▼搴忎腑宸茬粡鏈夐暱寤舵椂鐨勯櫎澶栵紝渚嬪鎸変笅鎸夐敭鏁板瓧鍔1,鍔1鍚庡彟鏈夎緝闀挎椂闂寸殑鍏跺畠绋嬪簭娈佃鎵ц锛屽疄闄呬笂灏辫捣娑堟姈浣滅敤浜嗐
绛旓細VCC銆丟ND銆丼DA銆丼CL鐨勫竷灞涓庤繛鎺</寮婧愪唬鐮佺殑绮鹃珦锛氱紪鍐欎笌璋冭瘯绋嬪簭</鐩磋鐨勬帴绾跨ず鎰忓浘锛岃浣犱竴鐩簡鐒</姣忎竴涓姝ラ閮芥棬鍦ㄦ彁鍗囦綘鐨缂栫▼鎶鑳斤紝璁╀綘鍦ㄥ疄璺典腑娣卞叆鐞嗚ВI2C鎵╁睍鏉跨殑宸ヤ綔鍘熺悊銆傞氳繃杩欎簺瀹為獙锛屼綘涓嶄粎鑳芥帉鎻CF8574鐨勪娇鐢紝杩樺皢涓烘湭鏉ユ洿澶氱殑Arduino椤圭洰鎵撲笅鍧氬疄鐨勫熀纭銆
绛旓細LCD_write_english_string(0,0," --Arduino-- "); LCD_write_english_string(0,2,"Renge:"); LCD_write_english_string(0,4,"DESIGN BY KENT"); LCD_write_english_string(0,5," 2010.6 "); while(1) { digitalWrite(outputPin, LOW); // 浣垮彂鍑哄彂鍑鸿秴澹版尝淇″彿鎺ュ彛浣庣數骞2渭s delayMicroseconds...
绛旓細鍖哄埆锛1銆乤rduino鐢ㄧ殑鏄疉VR鍗曠墖鏈猴紝AVR鍗曠墖鏈鸿窡51鍗曠墖鏈哄唴閮ㄧ粨鏋勪笉鍚岋紙瀵勫瓨鍣ㄥ灏戝拰鍚嶇О閮 涓嶄竴鏍凤級锛岀紪绋嬪伐鍏风儳鍐欒蒋浠跺潎涓嶄竴鏍枫2銆arduino缂栫▼灏嗕竴浜涜緭鍏ヨ緭鍑烘柟娉曠紪鎴愪簡瀛愮▼搴忥紙搴撳嚱鏁帮級锛屽簲鐢ㄦ洿鍔犳柟渚裤3銆arduino鍦杞欢寮鍙戝弽闈㈣冭檻鐨勬洿澶氱殑鏄姛鑳界殑瀹炵幇锛岃屽崟鐗囨満寮鍙戣繕闇瑕佽冭檻鐩稿簲鐨勫鍥寸數璺紝鍜屽簳灞...
绛旓細浣垮緱鐢ㄦ埛鍙互鏇村姞杞绘澗鍦拌繘琛岀‖浠缂栫▼銆Arduino璇█鐨勭紪绋嬫柟寮忕被浼间簬C++锛屽寘鎷彉閲忋佹帶鍒剁粨鏋勩佸嚱鏁扮瓑鍩烘湰璇硶锛屽悓鏃惰繕鏈夎澶氬簱鍑芥暟鍙互鏂逛究鐢ㄦ埛杩涜鍚勭鎿嶄綔锛屽鎺у埗GPIO鍙c佽鍙栦紶鎰熷櫒鏁版嵁銆佽繘琛屼覆鍙i氳绛夈侫rduino璇█鐨勪唬鐮佸彲浠ュ湪Arduino IDE涓紪鍐欏拰璋冭瘯锛岀劧鍚庝笂浼犲埌Arduino鏉夸笂杩愯銆
绛旓細浣犵殑闂鏄Arduino IDE鍦ㄥ皾璇曠紪璇戦」鐩椂鎵句笉鍒版煇涓簱鐨勫ご鏂囦欢锛岃繖閫氬父鏄敱浜庝互涓嬪嚑涓師鍥犲紩璧风殑锛1. 搴撳畨瑁呬笉姝g‘锛氱‘淇濅綘宸茬粡姝g‘鍦板皢搴撴枃浠舵斁鍦ㄤ簡Arduino鐨刲ibraries鏂囦欢澶逛腑銆傚浜庝綘鐨勯棶棰橈紝杩欎釜鏂囦欢澶瑰簲璇ュ湪 "C锛歕Users\鏉ㄦ煚鏅甛Documents\Arduino\libraries" 涓2. 鏂囦欢缁撴瀯涓嶆纭細Arduino搴撻氬父...
绛旓細鍦Arduino缂栫▼涓紝val 閫氬父鏄綔涓轰竴涓畝鍐欐潵琛ㄧず "value"锛堝硷級鐨勬剰涔夈傝繖鏄竴涓父瑙佺殑鍛藉悕绾﹀畾锛岀敤浜庣粰鍙橀噺鍙栧悕锛屼互渚跨▼搴忓憳鏇村鏄撶悊瑙e叾鐢ㄩ斻傚湪缂栧啓Arduino浠g爜鏃讹紝绋嬪簭鍛橀氬父浼氶夋嫨鍏锋湁鎻忚堪鎬х殑鍙橀噺鍚嶇О锛屼互鎻愰珮浠g爜鐨勫彲璇绘с備緥濡傦紝濡傛灉鎮ㄥ湪Arduino浠g爜涓湅鍒颁互涓嬩唬鐮侊細cppCopy codeint val = ...