Hi,
I am running the following code to help with a robot project.
It outputs 3 numbers, but I want to use only the 3rd accelerometer output %f in my project.
How do I extract the last number from the %f %f %f bit?
Thanks
CJ
I am running the following code to help with a robot project.
Code:
import timeimport boardimport busioimport adafruit_adxl34xi2c = busio.I2C(board.SCL, board.SDA)accelerometer = adafruit_adxl34x.ADXL345(i2c)while True: print("%f %f %f"%accelerometer.acceleration) time.sleep(1)
How do I extract the last number from the %f %f %f bit?
Thanks
CJ
Statistics: Posted by Candyjet — Thu Jan 25, 2024 12:31 pm