查看(SKU:RB-05L007)LCD4884液晶搖桿擴展板的源代碼
←
(SKU:RB-05L007)LCD4884液晶搖桿擴展板
跳轉至:
導航
、
搜索
因為以下原因,你沒有權限編輯本頁:
您剛才請求的操作只有這個用戶組中的用戶才能使用:
用戶
您可以查看并復制此頁面的源代碼:
<br/> [[文件:faef1.jpg|500px|有框|右]] ==產(chǎn)品概述== 最新推出的LCD4884 LCD Joystick Shield v2.0 LCD4884液晶屏擴展板是哈爾濱奧松機器人科技有限公司研發(fā)的一款黑白屏液晶擴展板。此擴展板采用Nokia 5110液晶屏為顯示器件。SPI接口,最大限度的節(jié)省I/O資源。特別添加五向搖桿,方便實現(xiàn)搭建人機互動接口,剩余的模擬與數(shù)字接口全部用插針引出,便于安裝其它傳感器與模塊。本品適用于各種開發(fā)板和控制器,例如:Arduino控制器、STC單片機、AVR單片機等。 ==規(guī)格參數(shù)== # 產(chǎn)品名稱:LCD4884液晶搖桿擴展板 # 產(chǎn)品貨號:RB-05L007 # 工作電壓:DC5V # 產(chǎn)品類型:Arduino擴展板 # 制作工藝:FR4雙面噴錫 # 人性化設計:具有可人機互動接口“五項搖桿” # 工作溫度:10℃-30℃ # 重量:28g # 產(chǎn)品尺寸:69.47mm x 53.34mm x 18mm # 發(fā)貨清單:LCD4884液晶搖桿擴展板×1 # 包裝方式:靜電袋密封 # 選配配件:3PIN傳感器連接線、Arduino 328控制器等 # 板載資源: * 數(shù)字接口:8個 * 模擬輸入借口:5個 * 48×84液晶:1個 * 無向搖桿按鍵:1個 * 系統(tǒng)復位按鍵:1個 ==使用方法== ===使用硬件=== * Carduino UNO 控制器 * 1個 * LCD4884 Joystick Shield ×1 * USB數(shù)據(jù)通信線×1 ===例子程序=== 程序上傳前需要先下載鏈接:https://pan.baidu.com/s/1rZRC6a2eQGpZs_oCbAPEuw?pwd=n7yp 提取碼:n7yp LCD4884 程序使用到的庫文件,將它放到Arduino安裝目錄下的libraries文件夾下<br/> <pre style='color:blue'> /* YourDuinoStarter Example: LCD SHIELD with 'Joystick' button - WHAT IT DOES Displays on LCD4884, reads button - SEE the comments after "http://" on each line below - CONNECTIONS: - LCD 4884 Shield has all connections - NOTE: Start Serial Monitor to see switch voltage values - V1.00 02/08/2016 Questions: terry@yourduino.com */ /*-----( Import needed libraries )-----*/ #include <LCD4884.h> // UPDATED version 2/16 Yourduino /*-----( Declare Constants and Pin Numbers )-----*/ #define LCD_BACKLIGHT_PIN 7 /*-----( Declare objects )-----*/ //None: Included in library /*-----( Declare Variables )-----*/ int displayDelay = 1000; int switchDelay = 100; // Switch scanning delay int switchVoltage ; // From Analog read of the button resistors void setup() /****** SETUP: RUNS ONCE ******/ { Serial.begin(115200); pinMode(LCD_BACKLIGHT_PIN, OUTPUT); lcd.LCD_init(); // creates instance of LCD lcd.LCD_clear(); // blanks the display for (int a = 0; a < 5; a++) { digitalWrite(LCD_BACKLIGHT_PIN, LOW); delay(300); digitalWrite(LCD_BACKLIGHT_PIN, HIGH); delay(300); } for (int a = 0; a < 6; a++) { lcd.LCD_write_string(0, a, "01234567980123", MENU_NORMAL); // ignore MENU_NORMAL for now delay(displayDelay); } delay(displayDelay); lcd.LCD_clear(); // blanks the display delay(500); // Show the BIG characters (0..9, + - only) lcd.LCD_write_string_big(0, 0, "012345", MENU_NORMAL); lcd.LCD_write_string_big(0, 3, "-+-+-+", MENU_NORMAL); delay(1000); lcd.LCD_clear(); // now read the joystick using analogRead(0 }//--(end setup )--- void loop() /****** LOOP: RUNS CONSTANTLY ******/ { lcd.LCD_write_string(1, 1, "PUSH A BUTTON", MENU_NORMAL); switchVoltage = analogRead(0); Serial.print("Switch analog value = "); Serial.println(switchDelay); if (switchVoltage == 0) { lcd.LCD_write_string(2, 2, "LEFT ", MENU_NORMAL); } else if (switchVoltage > 0 && switchVoltage < 180) { lcd.LCD_write_string(2, 2, "PUSH IN", MENU_NORMAL); delay(switchDelay); } else if (switchVoltage > 180 && switchVoltage < 400) { lcd.LCD_write_string(2, 2, "DOWN ", MENU_NORMAL); delay(switchDelay); } else if (switchVoltage > 400 && switchVoltage < 600) { lcd.LCD_write_string(2, 2, "RIGHT", MENU_NORMAL); delay(switchDelay); } else if (switchVoltage > 600 && switchVoltage < 800) { lcd.LCD_write_string(2, 2, "UP ", MENU_NORMAL); delay(switchDelay); } else if (switchVoltage > 800) { lcd.LCD_write_string(2, 2, "NONE ", MENU_NORMAL); delay(switchDelay); } } //--(end main loop )--- /*-----( Declare User-written Functions )-----*/ //NONE //*********( THE END )*********** </pre> ===程序效果=== [[文件:faef2.jpg|500px|有框|居中]] [[文件:faef3.jpg|500px|有框|居中]] [[文件:faef4.jpg|500px|有框|居中]] [[文件:faef5.jpg|500px|有框|居中]] ==視頻演示== [[File:LCD4884 01.png|400px|左|link=http://v.youku.com/v_show/id_XNDU0MzE5NjIw.html?from=y1.7-2]] <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> ==產(chǎn)品相關推薦== [[文件:erweima.png|230px|無框|右]] ===購買地址=== [http://gharee.com/goods-44.html LCD4884液晶搖桿擴展板] ===周邊產(chǎn)品推薦=== [http://gharee.com/goods-126.html 1602液晶顯示器 藍白屏 ] <br/> [http://gharee.com/goods-129.html Arduino IIC/I2C LCD1602 字符液晶顯示器] ===相關問題解答=== [http://www.makerspace.cn/forum.php?mod=viewthread&tid=4009&highlight=lcd4884 LCD4884液晶搖桿擴展板顯示應用]<br/> [http://www.makerspace.cn/forum.php?mod=viewthread&tid=3250&highlight=lcd4884 關于arduino的LCD4884的使用] ===相關學習資料=== [http://v.youku.com/v_show/id_XNDU0MzE5NjIw.html 操作視頻]<br/> [http://www.makerspace.cn/portal.php 奧松機器人技術論壇]
返回
(SKU:RB-05L007)LCD4884液晶搖桿擴展板
。
來自“
http://gharee.com/wiki/index.php/(SKU:RB-05L007)LCD4884液晶搖桿擴展板
”
導航菜單
個人工具
登錄
名字空間
頁面
討論
變換
查看
閱讀
查看源代碼
查看歷史
操作
搜索
導航
首頁
社區(qū)專頁
新聞動態(tài)
最近更改
隨機頁面
工具箱
鏈入頁面
相關更改
特殊頁面
頁面信息
隱私政策
關于ALSROBOT WiKi
免責聲明