Could you help w/ 1 more problem
I want to change PORTC pins from the $50 robot tutorial to digital input versus analog input. I know it has something to do w/
DDRC = 0x00; //configure all C ports for input
PORTC = 0x00; //make sure pull-up resistors are turned off
DDRD = 0xFF; //configure all D ports for output
DDRB = 0xC7; //configure B ports 0, 1, 2, 6, 7 for output (google search '0b11000111 to hex')
but frankly I can't make heads or tails of how to alter that. I know I need to make sure the pull-up resistors are turned on, but... I don't know how to alter that command. Also I've seen code like this
#define F_CPU 8000000UL /* 8MHz crystal oscillator */
#define BUTTON_PORT PORTD /* PORTx - register for button output */
#define BUTTON_PIN PIND /* PINx - register for button input */
#define BUTTON_BIT PD2 /* bit for button input/output */
which I can only deduce is a different method of altering the it. The question of the hour now is, how do I turn on the pull-up resistor, can I just comment out the PORTC=0x00 and put PORTC|=_BV(#of pin), albeit I'll have to do that several times. Another way I see is finding the hex number that would do that, but it seems rather ambiguous and I have no idea what to search for that. Also is there a step I'm missing?
Also a link to a tutorial would also be nice, one that specifically deals w/ this since I've found several but they only mention and show how to do it once, w/o much explanation.
EDIT: NVM I think I figured it out, but a nice link to a tutorial site would be nice. A recommended one, since I can't tell which ones are good atm >_>