Transferring serial data to analog pin

I was working on some project in which there is bolt which is connected over uart (rx nad tx) to arduino. So sensors are connected to my arduino and there is some calculation happening and i am left with a variable which has the infrmation which i need. Now i want thaty information to go the pin A0 of the bolt so that i can use the analog read method to see the data. How can i do that.

Hi @jindaldhruva,

Check this project https://www.hackster.io/bolt-iot-developers-u-p-region/trash-talker-using-bolt-iot-f2af5e and go to the bottom of the page, you will find the Arduino and python code.

In serial print, I am passing the reading of ultrasonic reading -

void loop() {

  Serial.println(ultrasonic.distanceRead());
  delay(1000);
} 

and then fetching the same data in python code,.

response = mybolt.serialRead('10')  #Fetching the value from Arduino
data = json.loads(response)
garbage_value = data['value'].rstrip()

So in place of ultrasonic.distanceRead()), you can pass your variable.

Do let me know in case you need any other information.

@rahul.singh1, that was not m exact doubt. Please click on the link below to hear the audio message as it would be better if i explained it that way.
[https://drive.google.com/file/d/1ptUaKe_sjmb-mbdKFGWhwT8_W2GVyMNH/view?usp=sharing]
PS: IN THE ABOVE RECORDING FROM 0:46 = 0:56, WHAT I MEANT WAS THIS:
https://cloud.boltiot.com/remote /API KEY/alalogRead?pin=A0&deviceName=BOLTXXXX

Hi @jindaldhruva,

Yes got it. I am inviting @vinayak.joshi to check with him if we can send the serial data to pin A0.

Hi @jindaldhruva,

It is not possible for you to use analogRead API to read a value from the Arduino.

You have to use the serial API to pull the data from the Arduino.

May I know why you want to use the AnalogRead API over the SerialRead API to do this work?

@vinayak.joshi, so : 1. can i do the serial read api even if my there is no python script running on my bolt? Also, as you asked , i was preferring to use the analog read method as through integromat, I can perform functions based on the value of the analog pin. 2. So, will i be able to perform those functions on integromat with the serial read as well (for eg- if value is greater than this then pin high)? Also, 3. what is the bolt -arduino-helper library?