Controlling blink rate via serial monitor

Hello to the community
Just for a heads up I am a beginner. I have been reading Serial input basic tutorial by Robin2 in the arduino forum and it is a great tutorial so I tried to use his example of “Receiving several characters from the Serial Monitor” sketch mixed with the “blink without delay” sketch from the arduino IDE examples. I wanted to try and control my LED blink rate via the serial terminal eg. 12 entered into the serial terminal sets the on board LED to a 12 second blink rate. I have both the codes working in the same sketch independently but cant seem to figure out how to set the input value in the terminal to the blink rate variable called “interval”. I have tried a few methods and none work If anyone has any hints,advice or examples greatly appreciated.

love_child_just_need_to_make_input_change_blink.ino (2.74 KB)

but cant seem to figure out how to set the input value in the terminal to the blink rate variable called "interval".

Since you have declared interval to be const, you can never assign it a new value.

If you want to change to value of interval, it can't be const.

Robin2's tutorial shows how to actually use the data that you received. You seem to have glossed over that part.

Thank for the hint. :blush:

Got it working now.

Cheers.