Guest User

Untitled

a guest
May 27th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. int sensor1 = 0;
  2. int sensor2 = 0;
  3. int incoming = 0;
  4.  
  5. void setup() {
  6. // put your setup code here, to run once:
  7. Serial.begin(9600);
  8.  
  9. pinMode(3, OUTPUT);
  10. }
  11.  
  12. void loop() {
  13. sensor1 = analogRead(A0);
  14. sensor2 = analogRead(A1);
  15.  
  16. Serial.print(sensor1);
  17. Serial.print(",");
  18. Serial.println(sensor2);
  19.  
  20. if (Serial.available()) {
  21. incoming = Serial.read();
  22. analogWrite(3, incoming);
  23. }
  24. }
Add Comment
Please, Sign In to add comment