我正在编写一个程序,通过beaglebone black上的i2c访问Accelerometer和Gyroscope上的WHO_AM_I寄存器。这是基本代码。
import asana
client = asana.Client.basic_auth('ASANA_API_KEY')
workspaces = client.workspaces.find_all({"opt_fields": "is_organization, name"})
workspace = next(workspace for workspace in workspaces if workspace['name'] == 'Moon Landing')
project = {'name':'Training','workspace': workspace['id']}
if workspace['is_organization'] :
teams = client.teams.find_by_organization(workspace['id'])
team = next(team for team in teams if team['name'] == 'Astronauts')
project['team'] = team['id']
training = client.projects.create(project)
` 我得到零件ID为零,但是当我使用i2cget命令探测传感器时,它给出了预期的“0xC7”值。知道我做错了吗?