Guest User

Untitled

a guest
Oct 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. void setup()
  2. {
  3. char* name[]={"This is string 1", "This is string 2", "This is string 3",
  4. "This is string 4", "This is string 5","This is string 6"};
  5. // initialize the serial communication:
  6. Serial.begin(9600);
  7. }
  8.  
  9. void loop() {
  10. byte name;
  11.  
  12. // check if data has been sent from the computer:
  13. if (Serial.available()) {
  14. // read the most recent byte (which will be from 0 to 255):
  15. name = Serial.read();
  16. // tell the name:
  17. //char str1[8] = {name};
  18. Serial.print("Hello, ");
  19. {
  20. int i = 0;{
  21. for ( i=0; i<6;i++){
  22.  
  23. Serial.print(name);
  24. }
  25.  
  26.  
  27. }
  28. Serial.print("!");
  29. }
  30. }
  31. }
  32.  
  33. This is what I get in return for sending 'Hello':
  34.  
  35. Hello, 727272727272!Hello, 101101101101101101!Hello, 108108108108108108!Hello, 108108108108108108!Hello, 111111111111111111!
Add Comment
Please, Sign In to add comment