Advertisement
RuiViana

Higro_FOR

Feb 9th, 2016
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. #include <SoftwareSerial.h> // Inlcui a biblioteca SoftwareSerial.h
  2. #define RxD 6 // Define RxD como 6
  3. #define TxD 7 // Define TxD como 7
  4. SoftwareSerial Equipo(RxD,TxD); // Instância a biblioteca SoftwareSerial.h
  5.  
  6. char DadosRecebe[25] ;
  7. int i ; // Incremento
  8. //------------------------------------------------
  9. void setup()
  10. {
  11. Serial.begin(9600);
  12. Equipo.begin(9600); // Configura o baud rate do equipamento como 9600
  13. }
  14. //------------------------------------------------
  15. void loop()
  16. {
  17. if(Equipo.available()) // Se algo for recebido pela serial do módulo bluetooth
  18. {
  19. DadosRecebe[i] = Equipo.read();
  20. delay(10);
  21. i++;
  22. }
  23. for (int k = 0; k <= i; k++)
  24. {
  25. Serial.println(DadosRecebe[k],HEX);
  26. }
  27. i = 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement