Line 97... |
Line 97... |
97 |
spi.SPI_write_byte(self.CS, 0x10) |
97 |
spi.SPI_write_byte(self.CS, 0x10) |
98 |
spi.SPI_write_byte(self.CS, 0x06) # DEC |
98 |
spi.SPI_write_byte(self.CS, 0x06) # DEC |
99 |
spi.SPI_write_byte(self.CS, 0x00) |
99 |
spi.SPI_write_byte(self.CS, 0x00) |
100 |
spi.SPI_write_byte(self.CS, 0x10) |
100 |
spi.SPI_write_byte(self.CS, 0x10) |
101 |
spi.SPI_write_byte(self.CS, self.L6470_KVAL_RUN) # KVAL_RUN |
101 |
spi.SPI_write_byte(self.CS, self.L6470_KVAL_RUN) # KVAL_RUN |
102 |
spi.SPI_write_byte(self.CS, 0x28) |
102 |
spi.SPI_write_byte(self.CS, 0x58) |
103 |
spi.SPI_write_byte(self.CS, self.L6470_KVAL_ACC) # KVAL_ACC |
103 |
spi.SPI_write_byte(self.CS, self.L6470_KVAL_ACC) # KVAL_ACC |
104 |
spi.SPI_write_byte(self.CS, 0x28) |
104 |
spi.SPI_write_byte(self.CS, 0x58) |
105 |
spi.SPI_write_byte(self.CS, self.L6470_KVAL_DEC) # KVAL_DEC |
105 |
spi.SPI_write_byte(self.CS, self.L6470_KVAL_DEC) # KVAL_DEC |
106 |
spi.SPI_write_byte(self.CS, 0x28) |
106 |
spi.SPI_write_byte(self.CS, 0x58) |
107 |
# spi.SPI_write_byte(self.CS, 0x18) # CONFIG |
107 |
# spi.SPI_write_byte(self.CS, 0x18) # CONFIG |
108 |
# spi.SPI_write_byte(self.CS, 0b00111000) |
108 |
# spi.SPI_write_byte(self.CS, 0b00111000) |
109 |
# spi.SPI_write_byte(self.CS, 0b00000000) |
109 |
# spi.SPI_write_byte(self.CS, 0b00000000) |
110 |
self.MaxSpeed(self.maxspeed) |
110 |
self.MaxSpeed(self.maxspeed) |
111 |
|
111 |
|
Line 260... |
Line 260... |
260 |
|
260 |
|
261 |
time.sleep(1) |
261 |
time.sleep(1) |
262 |
|
262 |
|
263 |
X.Run(1, SPEED/2) |
263 |
X.Run(1, SPEED/2) |
264 |
|
264 |
|
265 |
time.sleep(3) |
265 |
time.sleep(5) |
266 |
|
266 |
|
267 |
X.Float(hard = False) # release power |
267 |
X.Float(hard = False) # release power |
268 |
|
268 |
|
269 |
|
269 |
|
270 |
finally: |
270 |
finally: |