fix sense pin

This commit is contained in:
Dennis Gunia
2025-11-01 23:47:01 +01:00
parent 09a4326e53
commit 3b6743728d
2 changed files with 3 additions and 3 deletions

View File

@@ -173,7 +173,7 @@ ISR(TIMER1_COMPA_vect)
absolute_pos -= STEPS_PER_REV;
}
// detect home position
if ((PIND & (1 << PD3)) == 0)
if ((PIND & (1 << PD4)) == 0)
{
if (lastSens == 0)
{

View File

@@ -12,9 +12,9 @@
void rs485_init()
{
// 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
PORTD &= 0x07; // clear PD0-PD4
PORTD &= 0xE0; // clear PD0-PD4
// init UART
UBRRH = (BAUDRATE >> 8);
UBRRL = BAUDRATE; // set baud rate