Posted By

danielescobar on 08/11/19


Tagged

prueba arduino


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

danielescobar


Prueba de Arduino


 / Published in: C++
 

Esta es una prueba con snipplr

  1. #include <SensorDistanciaHCSR04.h>
  2.  
  3. SensorDistanciaHCSR04 sensor1(2,3,60);
  4.  
  5. void setup(){
  6. Serial.begin(9600);
  7. }
  8.  
  9. void loop() {
  10. sensor1.update ( );
  11.  
  12. if ( sensor1.changed )
  13. enviarDatoSerial ( "sensor1/" + String ( sensor1.distancePercent ) );
  14.  
  15. delay ( 20 );
  16. }
  17.  
  18. void enviarDatoSerial ( String dato )
  19. {
  20. String mensaje =dato + "\n";
  21. Serial.print ( mensaje );
  22. }

Report this snippet  

You need to login to post a comment.