How can I store my sensor data into a variable?

Can someone help me with this?

Code:

setChartLibrary(‘google-chart’);
setChartTitle(‘Temperature Values’);
setChartType(‘lineGraph’);
setAxisName(‘Time’,‘Temperature’);
mul(0.0977);
plotChart(‘time_stamp’,‘temp_sen’);

temp = analogRead(A0);
if(temp>29)

{
digitalWrite(4,“HIGH”);
}
else
{
digitalWrite(4,“LOW”);
}

I am not getting any value in the temp variable. Is there something I am missing?
Please HELP!!

@murtazasultan94 you must be writing this code in the code tab of the product.

Basically we are provided with the code tab in cloud so that we can use the graph’s functionality. We can do only that if we upload a js file in the code tab. If you want to use the GPIO commands i.e. analigRead and other ones then you have to code a html file in the code tab

First select the html extension in the code tab and then include the script file for the API commands and then in the html file you can work with the GPIO commands.

Thank you for the reply

Your welcome @murtazasultan94 do close the query by clicking on Solution button on my previous post :slight_smile:

1 Like