简体   繁体   English

Mega的Arduino LCD2004D草图

[英]Arduino LCD2004D Sketch for Mega

I've been hunting this down for a couple of days now and simply haven't been making any headway. 我已经搜寻了几天了,只是没有取得任何进展。

I have a http://reprap.org/wiki/RepRapDiscount_Smart_Controller it came with a kit from china. 我有一个http://reprap.org/wiki/RepRapDiscount_Smart_Controller,它带有一个来自中国的工具包。

I'm trying to interact with the LCD, and the SD card reader. 我正在尝试与LCD和SD卡读取器进行交互。

Every single piece of info I can find tells me to use LiquidCrystal.h, All of them tell me what pins to use on an Uno, and every time I find someone with a Mega, the person is having the same problem as me, there's something hard coded somewhere, that does not translate to an Arduino Mega. 我能找到的每条信息都告诉我使用LiquidCrystal.h,所有这些信息都告诉我在Uno上使用什么销钉,每当我发现有人有Mega时,该人与我都有相同的问题,在某处进行硬编码的东西,不会转换为Arduino Mega。

So simply put, can someone who has some experience with this, give a sketch for the MEGA + RAMPS1.4 + LCD2004D + SD Card Reader 简而言之,有经验的人可以为MEGA + RAMPS1.4 + LCD2004D + SD卡读卡器画一个草图

This is what I have managed to get so far 到目前为止,这是我设法做到的

#define LCD_RS 16
#define LCD_ENABLE 17
#define LCD_D1 23
#define LCD_D2 25
#define LCD_D3 27
#define LCD_D4 29

 //encoder pins  
#define BTN_EN1 31
#define BTN_EN2 33
#define BTN_ENC 35

 //beeper
#define BEEPER 37

 //SD card detect pin  
#define SDCARDDETECT 49

#define SDPOWER            -1
#define MOSI  51
#define MISO  50
#define SCK   52
#define SDSlaveSelect 53

I have confirmed that these ARE the correct pins as connected via the RAMPS1.4 jumper board and EXT 1 and EXT 2 connectors, though I can't confirm that they are linked to what I have written here, since there's no real info for this that I can get my hands on. 我已经确认这些是通过RAMPS1.4跳线板以及EXT 1和EXT 2连接器连接的正确引脚,尽管我无法确认它们是否与我在此处编写的内容相关联,因为这里没有真正的信息。我可以动手了。

And Please Please Please if you can help, or do help, make your answer easy to decode, because I will be working with the LCD Controller for now, and may upgrade later, so I hopefully will learn something here for when I switch controllers then! 如果您能帮助或帮助您,请使您的答案容易理解,因为我现在将使用LCD控制器,并且以后可能会升级,所以希望我在这里学习一些关于控制器切换的知识。 !

(or a working sketch would be AweSome!) (或工作草图将是AweSome!)

Thank you anyone in advance. 预先感谢任何人。

Here is the lcd 1602 model which is the smaller brother of the 2004, https://www.sunfounder.com/learn/Super-Kit-V2-0-for-Arduino/lesson-8-lcd1602-super-kit.html it illustrates how to connect and program for Arduino using the parallel connection which is similar to the 2004 model. 这是LCD 1602型号,它是2004年的较小型号, https://www.sunfounder.com/learn/Super-Kit-V2-0-for-Arduino/lesson-8-lcd1602-super-kit.html它说明了如何使用类似于2004年模型的并行连接为Arduino连接和编程。

A lot of the lcds that i have seen for the 2004 model have a serial to parallel driver board which could be an option as driving an i2c board is easier to implement and uses less pins. 我在2004年的型号中看到的许多LCD都有串行到并行驱动器板,这可能是一个选择,因为驱动i2c板更容易实现且使用的引脚更少。

For example http://www.ebay.com/itm/IIC-I2C-TWI-SP-I-Serial-Interface-Board-Module-LCD1602-2004-Display-For-Arduino-/172591106177?hash=item282f3b4881:g:jDoAAOSw4CFY1JTI 例如http://www.ebay.com/itm/IIC-I2C-TWI-SP-I-Serial-Interface-Board-Module-LCD1602-2004-Display-For-Arduino-/172591106177?hash=item282f3b4881:g :jDoAAOSw4CFY1JTI

i hope this has given you some ideas to try out. 我希望这给了您一些尝试的想法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM