1,5 → 1,5 |
#include "main.h" |
#use i2c(Slave,Fast,sda=PIN_B1,scl=PIN_B4,force_hw,address=0xA2) // Motor 2 |
#use i2c(Slave,Fast,sda=PIN_C4,scl=PIN_C3,force_hw,address=0xA2) // Motor 2 |
|
#define H1 PIN_A1 |
#define L1 PIN_A2 |
15,17 → 15,17 |
|
output_a(0); // vypnuti vsech budicu |
|
state = i2c_isr_state(); |
state = i2c_isr_state(); |
|
if(state < 0x80) //Master is sending data |
{ |
command = i2c_read(); |
} |
if(state < 0x80) //Master is sending data |
{ |
command = i2c_read(); |
} |
|
if(state == 0x80) //Master is requesting data |
{ |
i2c_write(command); |
} |
if(state == 0x80) //Master is requesting data |
{ |
i2c_write(command); |
} |
} |
|
|