247
edits
No edit summary |
|||
Line 49: | Line 49: | ||
01. Initialize five sensors, receive data values from Arduino, and send them to Max. | 01. Initialize five sensors, receive data values from Arduino, and send them to Max. | ||
int val[6];//array.5 light sensors total | |||
val[ | |||
void setup() { | |||
Serial. | Serial.begin(9600); //Serial Communication set up | ||
Serial | |||
} | } | ||
void loop() { | |||
//Read analog inputs one by one and send them to Max/Msp | |||
// (val, from min, from max, to min,to max) | |||
//map(valueToBeMapped,0,1023,0,300); | |||
for(int i = 0; i < 5; i++){ | |||
val[i] = map(analogRead(i),0,1023,0,analogRead(A5)); | |||
Serial.print(val[i]); | |||
Serial.print(" "); | |||
} | |||
Serial.print(analogRead(A5)); | |||
Serial.print(" "); | |||
Serial.println(); | |||
delay(10); | |||
C. MAX/MSP | C. MAX/MSP |
edits