1,6 → 1,6 |
#include "motor.h" |
//#use i2c(Slave,Fast,sda=PIN_B1,scl=PIN_B4,force_hw,address=0xA0) // Motor 1 |
//#use i2c(Slave,Fast,sda=PIN_B1,scl=PIN_B4,force_hw,address=0xA2) // Motor 2 |
#use i2c(Slave,Fast,sda=PIN_B1,scl=PIN_B4,force_hw,address=0xA2) // Motor 2 |
|
#define H1 PIN_A1 |
#define L1 PIN_A2 |
46,17 → 46,14 |
enable_interrupts(GLOBAL); |
enable_interrupts(INT_SSP); |
|
command=0; // zastaveni po resetu |
command=-128; // zastaveni po resetu |
|
while(true) |
{ |
|
if ((0==command) || (command>127) || (command<-127)) // prikaz na odpojeni mustky nebo chybna hodnota |
if (command==-128) // prikaz na odpojeni mustku nebo chybna hodnota |
{ |
output_low(H1); // stop |
output_low(H2); |
output_low(L1); |
output_low(L2); |
output_a(0); // volnobeh |
continue; |
}; |
|