When you serialprint from arduino, the data is put on serial monitor.
(Here serial monitor is a 2 way communication channel, like a whatsapp chat. Only difference is, its a notepad where values are written.)
When the data is printed on serial monitor, you can use serialRead to take the already present in the monitor(sent by arduino) and use that information for performing something.
Not really a little bit so bolt module take values from the one printed on serial moniter so if I delay printing on serial moniter we are slowing down pushing of data to bolt module correct me if Iâm wrong
Hey one more problem I observed is when I exit infinite while loop by pressing Ctrl + c and again run it âŚit starts from the point I stopped so the delay is increasing how to avoid that
What I want is bolt to take values when it turned on but not before that
If your arduino keeps pushing data to the serial monitor, bolt will pick up the value one by one, from the point of time your bolt was switched on and your arduinoâs loop was ran.
Declare a variable int A = 0 and do a serial.println(A++); Then run the python, exit the loop. Again run the python, exit the loop. You will see how it functions.
At this point, you have to use your own algorithms based on the type of project you want to build.
There are many projects on the internet related to serial communication.
So can you suggest any change in my project what I want is to use Bolt to send message through telegram when object is less than 40 cm away can u suggest what to do.
In python program, directly take sensor_value str(data[âvalueâ]) to print something like âObject is (sensor value) cm near. Sending a message on telegramâ, and send the following data through telegram as well.
I want you to write the logic yourself. Take your time and give your code a trial. We face many bugs, but itâs important to keep up with the process of trying.
hey can i do something like this âŚi want bolt to get readings from the point i run the script not from the point BOLT turned on
in other words i want arduino to start pushing data from the point when i start running python script but not the readings before that
No, you have to run python after your connections are done. It will anyways initiate the communication when serialBegin is initiated. Without that, bolt shouldnât be able to receive any data