GROLAB USERBOT HW01 Manuel D'installation page 18

Table des Matières

Publicité

Les langues disponibles
  • FR

Les langues disponibles

  • FRANÇAIS, page 71
A er opening the SensorsTask.cpp, navigate to
EN
the SensorsTask func on and search for the
comment that says '* IO Config *'. Below the
ES
comment, you will find an example pin configu-
FR
ra on that you should adjust to match your
components. For the example diagram the
PT
code should be the following:
IT
Now, navigate to the GoSensorsTask func on
and look at the switch. Inside the case
GET_IOS, you should add the code to sample
your inputs and update its respec ve values in
the inputs array. For example:
if (digitalRead(inputs[INPUT_INDEX0].arduinoPin))
inputs[INPUT_INDEX0].value = 255;
else
inputs[INPUT_INDEX0].value = 0;
Or if it's an output, inside the case
ACT_ON_IOS, you should add the code to act
on the outputs. For example:
if (outputs[OUTPUT_INDEX0].value > 0)
digitalWrite(outputs[OUTPUT_INDEX0].arduinoPin, HIGH);
else
digitalWrite(outputs[OUTPUT_INDEX0].arduinoPin, LOW);
17
7
1
17

Publicité

Table des Matières
loading

Table des Matières