Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup()
- {
- char* name[]={"This is string 1", "This is string 2", "This is string 3",
- "This is string 4", "This is string 5","This is string 6"};
- // initialize the serial communication:
- Serial.begin(9600);
- }
- void loop() {
- byte name;
- // check if data has been sent from the computer:
- if (Serial.available()) {
- // read the most recent byte (which will be from 0 to 255):
- name = Serial.read();
- // tell the name:
- //char str1[8] = {name};
- Serial.print("Hello, ");
- {
- int i = 0;{
- for ( i=0; i<6;i++){
- Serial.print(name);
- }
- }
- Serial.print("!");
- }
- }
- }
- This is what I get in return for sending 'Hello':
- Hello, 727272727272!Hello, 101101101101101101!Hello, 108108108108108108!Hello, 108108108108108108!Hello, 111111111111111111!
Add Comment
Please, Sign In to add comment