Hi, I'm currently working on some code in processing which allows me to use RFID tags to load multiple images. I have the code that sends data from the RFID in Arduino to processing working, but I also want to send data for the potentiometer values over to processing but unsure how to code this, I have tried some attempts but no success.
Code for RFID
/* RFID ID12
*/
char val = 0; // variable to store the data from the serial port
void setup() {
Serial.begin(9600); // connect to the serial port
pinMode(13,OUTPUT);
digitalWrite(13,HIGH);
}
void loop () {
// read the serial port
if(Serial.available() > 0) {
val = Serial.read();
Serial.print(val, BYTE);
}
}
and code for the potentiometer;
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
delay(1); // delay in between reads for stability
}
If you want to see me processing code, i'll happily post it.
Thanks