Advertisement
Guest User

;iaDHGSF[ '9n

a guest
Feb 5th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <QTRSensors.h>
  2. #include <ZumoReflectanceSensorArray.h>
  3. #include <ZumoMotors.h>
  4. //Setup the QTR sensor array
  5. #define NUM_SENSORS 6
  6. unsigned int sensor_values[NUM_SENSORS];
  7. ZumoReflectanceSensorArray sensors(QTR_NO_EMITTER_PIN);
  8. void setup()
  9. {
  10. Serial.begin(9600);
  11. }
  12. void loop()
  13. {
  14. //Read and print the sensor value of sensor[3] every 0.5 seconds
  15. //to the serial monitor.
  16. motors.setSpeeds(200,200);
  17. delay(200);
  18. sensors.read(sensor_values);
  19. Serial.println(sensor_values[0,1,2,3,4,5]);
  20. delay(500);
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement