mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Merge branch 'master' of https://github.com/processing/processing.git
This commit is contained in:
@@ -133,15 +133,15 @@ void loop()
|
||||
// so that you're sending 100 or 255:
|
||||
thirdSensor = 100 + (155 * digitalRead(2));
|
||||
// send sensor values:
|
||||
Serial.print(firstSensor, BYTE);
|
||||
Serial.print(secondSensor, BYTE);
|
||||
Serial.print(thirdSensor, BYTE);
|
||||
Serial.write(firstSensor);
|
||||
Serial.write(secondSensor);
|
||||
Serial.write(thirdSensor);
|
||||
}
|
||||
}
|
||||
|
||||
void establishContact() {
|
||||
while (Serial.available() <= 0) {
|
||||
Serial.print('A', BYTE); // send a capital A
|
||||
Serial.write('A'); // send a capital A
|
||||
delay(300);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ void setup()
|
||||
void loop() {
|
||||
// read analog input, divide by 4 to make the range 0-255:
|
||||
int analogValue = analogRead(0)/4;
|
||||
Serial.print(analogValue, BYTE);
|
||||
Serial.write(analogValue);
|
||||
// pause for 10 milliseconds:
|
||||
delay(10);
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@ void setup() {
|
||||
|
||||
void loop() {
|
||||
if (digitalRead(switchPin) == HIGH) { // If switch is ON,
|
||||
Serial.print(1, BYTE); // send 1 to Processing
|
||||
Serial.write(1); // send 1 to Processing
|
||||
} else { // If the switch is not ON,
|
||||
Serial.print(0, BYTE); // send 0 to Processing
|
||||
Serial.write(0); // send 0 to Processing
|
||||
}
|
||||
delay(100); // Wait 100 milliseconds
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user