Line 83... |
Line 83... |
83 |
spi.SPI_write_byte(self.CS, 0x10) |
83 |
spi.SPI_write_byte(self.CS, 0x10) |
84 |
spi.SPI_write_byte(self.CS, 0x06) # DEC |
84 |
spi.SPI_write_byte(self.CS, 0x06) # DEC |
85 |
spi.SPI_write_byte(self.CS, 0x00) |
85 |
spi.SPI_write_byte(self.CS, 0x00) |
86 |
spi.SPI_write_byte(self.CS, 0x10) |
86 |
spi.SPI_write_byte(self.CS, 0x10) |
87 |
spi.SPI_write_byte(self.CS, self.L6470_KVAL_RUN) # KVAL_RUN |
87 |
spi.SPI_write_byte(self.CS, self.L6470_KVAL_RUN) # KVAL_RUN |
88 |
spi.SPI_write_byte(self.CS, 0x28) |
88 |
spi.SPI_write_byte(self.CS, 0x18) |
89 |
spi.SPI_write_byte(self.CS, self.L6470_KVAL_ACC) # KVAL_ACC |
89 |
spi.SPI_write_byte(self.CS, self.L6470_KVAL_ACC) # KVAL_ACC |
90 |
spi.SPI_write_byte(self.CS, 0x28) |
90 |
spi.SPI_write_byte(self.CS, 0x18) |
91 |
spi.SPI_write_byte(self.CS, self.L6470_KVAL_DEC) # KVAL_DEC |
91 |
spi.SPI_write_byte(self.CS, self.L6470_KVAL_DEC) # KVAL_DEC |
92 |
spi.SPI_write_byte(self.CS, 0x28) |
92 |
spi.SPI_write_byte(self.CS, 0x18) |
93 |
spi.SPI_write_byte(self.CS, 0x18) # CONFIG |
93 |
spi.SPI_write_byte(self.CS, 0x18) # CONFIG |
94 |
spi.SPI_write_byte(self.CS, 0b00101110) # spolecny byte pro obe konfigurace |
94 |
spi.SPI_write_byte(self.CS, 0b00101110) # spolecny byte pro obe konfigurace |
95 |
spi.SPI_write_byte(self.CS, 0b10000000) # konfigurace pro interni oscilator |
95 |
spi.SPI_write_byte(self.CS, 0b10000000) # konfigurace pro interni oscilator |
96 |
# spi.SPI_write_byte(self.CS, 0b10000110) # konfigurace s externim oscilatorem |
96 |
# spi.SPI_write_byte(self.CS, 0b10000110) # konfigurace s externim oscilatorem |
97 |
self.MaxSpeed(self.maxspeed) |
97 |
self.MaxSpeed(self.maxspeed) |
Line 268... |
Line 268... |
268 |
direction = True |
268 |
direction = True |
269 |
requested_speed = SPEED * 1.2 # runnig the motor at 120% of the base motor speed |
269 |
requested_speed = SPEED * 1.2 # runnig the motor at 120% of the base motor speed |
270 |
|
270 |
|
271 |
if key == ['slower']: |
271 |
if key == ['slower']: |
272 |
running = True |
272 |
running = True |
273 |
direction = False |
273 |
direction = True |
274 |
requested_speed = SPEED * 0.8 |
274 |
requested_speed = SPEED * 0.8 |
275 |
|
275 |
|
276 |
if key == ['stop']: |
276 |
if key == ['stop']: |
277 |
running = False |
277 |
running = False |
278 |
|
278 |
|