immagino per un attimo che il codice di arduino sia il seguente:
const int greenLEDPin = 9;
const int redLEDPin = 11;
const int blueLEDPin = 10;
const int redSensorPIN = A0;
const int greenSensorPIN = A1;
const int blueSensorPIN = A2;
int redValue = 0;
int greenValue = 0;
int blueValue = 0;
int redSensorValue = 0;
int greenSensorValue = 0;
int blueSensorValue = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(greenLEDPin,OUTPUT);
pinMode(redLEDPin,OUTPUT);
pinMode(blueLEDPin,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
redSensorValue = analogRead(redSensorPIN);
delay(5);
greenSensorValue = analogRead(greenSensorPIN);
delay(5);
blueSensorValue = analogRead(blueSensorPIN);
redValue = redSensorValue/4;
greenValue = greenSensorValue/4;
blueValue = blueSensorValue/4;
}
posso intervenire in java utilizzando i valori di queste variabili?

Rispondi quotando
