View Single Post
Old 01-20-2018, 01:07 PM   #148 (permalink)
Barreled
EcoModding Lurker
 
Join Date: Dec 2017
Location: California
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
What parts of your code would I have to modify so it works with an Arduino Uno and the DFRobot DFR0009 LCD Shield? I can't post links yet but if you google the shield it brings you to a page with the pin allocation and some sample code using the LiquidCrystal library.

I played around with the code for awhile but couldn't make much progress. The two changes I tried were to add this code around line 7000:

Code:
const uint8_t lcdRegisterSelect =                      (1 << PORTB0); // on PORTB, 8
const uint8_t lcdEnable =                              (1 << PORTB1); // on PORTB, 9
const uint8_t lcdBit3 =                                (1 << PORTD7); // on PORTD, 7
const uint8_t lcdBit2 =                                (1 << PORTD6); // on PORTD, 6
const uint8_t lcdBit1 =                                (1 << PORTD5); // on PORTD, 5
const uint8_t lcdBit0 =                                (1 << PORTD4); // on PORTD, 4
const uint8_t lcdBrightness =                          (1 << DDB2); // on PORTB, 10
const uint8_t lcdContrast =                            (1 << DDD1); // on PORTD, 1
And this code around line 7139:

Code:
// set direction to output LCD data on selected port B pins
DDRB |= (lcdEnable | lcdRegisterSelect | lcdBrightness);

// set direction to output LCD data on selected port D pins
DDRD |= (lcdBit3 | lcdBit2 | lcdBit1 | lcdBit0 | lcdContrast);
I wasn't able to get the LCD to give me anything intelligible. Does it look like I'm on the right track or this a much more difficult change than I expected it to be? I was thinking it should be pretty simple to change the LCD input pins, but all my coding experience has been high-level and this port registry stuff is new to me.
  Reply With Quote