Read the 128-bit GoPiGo3 hardware serial number Returns touple: serial number as 32 char HEX formatted string, error
(self)
| 369 | return ("%d.%d.%d" % ((version / 1000000), ((version / 1000) % 1000), (version % 1000))) |
| 370 | |
| 371 | def get_id(self): |
| 372 | """ |
| 373 | Read the 128-bit GoPiGo3 hardware serial number |
| 374 | |
| 375 | Returns touple: |
| 376 | serial number as 32 char HEX formatted string, error |
| 377 | """ |
| 378 | outArray = [self.SPI_Address, self.SPI_MESSAGE_TYPE.GET_ID,\ |
| 379 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
| 380 | reply = self.spi_transfer_array(outArray) |
| 381 | if(reply[3] == 0xA5): |
| 382 | return ("%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X" % \ |
| 383 | (reply[4], reply[5], reply[6], reply[7], reply[8], reply[9], reply[10], reply[11], \ |
| 384 | reply[12], reply[13], reply[14], reply[15], reply[16], reply[17], reply[18], reply[19])) |
| 385 | raise IOError("No SPI response") |
| 386 | return "00000000000000000000000000000000" |
| 387 | |
| 388 | def set_led(self, led, red, green = 0, blue = 0): |
| 389 | """ |
no test coverage detected