fix sense pin
This commit is contained in:
@@ -173,7 +173,7 @@ ISR(TIMER1_COMPA_vect)
|
|||||||
absolute_pos -= STEPS_PER_REV;
|
absolute_pos -= STEPS_PER_REV;
|
||||||
}
|
}
|
||||||
// detect home position
|
// detect home position
|
||||||
if ((PIND & (1 << PD3)) == 0)
|
if ((PIND & (1 << PD4)) == 0)
|
||||||
{
|
{
|
||||||
if (lastSens == 0)
|
if (lastSens == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
void rs485_init()
|
void rs485_init()
|
||||||
{
|
{
|
||||||
// init I/O
|
// init I/O
|
||||||
DDRD &= ~(1 << PD0); // BUS_DIR & TX is OUTPUT
|
DDRD &= ~(1 << PD0); // RX is INPUT
|
||||||
DDRD |= (1 << PD3) | (1 << PD2) | (1 << PD1); // BUS_DIR & TX is OUTPUT
|
DDRD |= (1 << PD3) | (1 << PD2) | (1 << PD1); // BUS_DIR & TX is OUTPUT
|
||||||
PORTD &= 0x07; // clear PD0-PD4
|
PORTD &= 0xE0; // clear PD0-PD4
|
||||||
// init UART
|
// init UART
|
||||||
UBRRH = (BAUDRATE >> 8);
|
UBRRH = (BAUDRATE >> 8);
|
||||||
UBRRL = BAUDRATE; // set baud rate
|
UBRRL = BAUDRATE; // set baud rate
|
||||||
|
|||||||
Reference in New Issue
Block a user