you answered my question very exactly: I asked for the microcontrollertype and you answered
My question was unprecise. Of course the microcontroller-type is an important information.
Additionally the microcontroller-board is important too.
Are you using an Arduino Uno, or a selfmade PCB with just a pure ATmega328-Chip on it?
Or something else?
Best thing is to post a link to where you have bought the µC.
Then I was quoogling for "Arduino bluetooth HC-05 zs-04" expecting that google will come up with a lot of well suited tutorials. Nope. A lot of videos but I don't like videos because you can't cross-read-them in one minute.
Most of the non-video-tutorials are from bad or medium quality.
Finally I found a tutorial which seems to be quite good:
I choose this one because it uses a second serial-connection for the blue-tooth-modul which keeps the feature of beeing able to send debug-output to the serial monitor.
Most other tutorials use IO-pins 0 and 1 which occupies the serial-port that is used for programming the arduino. This would mean for each and every new version of your software
bad tutorials do it this way:
- unplug bluetooth module
- plug to computer
- choose comport in the Arduino-IDE
- upload software
- unplug computer
- re-plug bluetooth module
With a second serial connection like shown in the chosen tutorial everything can stay conected all the time.
I'm very sure that you will have additional questions just post them here always including the complete related code-version by using this method
You should post code by using code-tags
There is an automatic function for doing this in the Arduino-IDE
just three steps
- press Ctrl-T for autoformatting your code
- do a rightclick with the mouse and choose "copy for forum"
- paste clipboard into write-window of a posting
So take a look at the linked tutorial and try it.
best regards Stefan