Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1.  
  2. const int knockSensor = A0; // the piezo is connected to analog pin 0
  3. const int sensor2 = A1;
  4. const int sensor3 = A2;
  5. const int sensor4 = A3;
  6. const int sensor5 = A4;
  7. const int sensor6 = A5;
  8. const int Pin = 13;
  9. // these variables will change:
  10. int sensorReading = 0;
  11. //int ledState;
  12.  
  13. void setup() {
  14. // pinMode(Pin,OUTPUT);
  15. Serial.begin(57600); // use the serial port
  16. }
  17.  
  18. void loop() {
  19. // read the sensor and store it in the variable sensorReading:
  20. sensorReading = analogRead(knockSensor);
  21. Serial.write(sensorReading);
  22. //Serial.println(sensorReading,"\t");
  23.  
  24. //digitalWrite(Pin,ledState);
  25. delay(1);
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement