MCPcopy Create free account
hub / github.com/DexterInd/GoPiGo3 / offset_motor_encoder

Method offset_motor_encoder

Software/C/GoPiGo3.cpp:311–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311int GoPiGo3::offset_motor_encoder(uint8_t port, int32_t position){
312 spi_array_out[0] = Address;
313 spi_array_out[1] = GPGSPI_MESSAGE_OFFSET_MOTOR_ENCODER;
314 spi_array_out[2] = port;
315 spi_array_out[3] = ((position >> 24) & 0xFF);
316 spi_array_out[4] = ((position >> 16) & 0xFF);
317 spi_array_out[5] = ((position >> 8) & 0xFF);
318 spi_array_out[6] = (position & 0xFF);
319 return spi_transfer_array(7, spi_array_out, spi_array_in);
320}
321
322int32_t GoPiGo3::get_motor_encoder(uint8_t port){
323 int32_t value;

Callers 3

ReadyForBalanceFunction · 0.45
handle_encodersFunction · 0.45
mainFunction · 0.45

Calls 1

spi_transfer_arrayFunction · 0.85

Tested by

no test coverage detected