Java Script with Proximity Sensor [Resolved]


#1

Please help me with the code below,

BOLT

Sensor Data

Read Pin

what should I enter in the “??” area,
also how to monitor continuously data?


#2

somebody help me on this !


#3

To get a contunes data update, I suggest you try the Bolt cloud. Specially the new updates given to the Beta Testers solve the issue. Try that out.


#4

I just started that module, I will try it, come back here if things are not solved!


#5

Kindly advise how to post the coding(display source code) in the forum, as it is displaying as a html output.


#6

Just remove the HTML Tags. Should work. (I hope)


#7

Let me try on my next question on the forum!


#8

The code is not working, on clicking the button, the page remains the same.


#9

This is not working!!


#10

Hi @mariarichy !
Right click on the page and do inspect element then click on the console. See if any error or warning message is there.


#11

Yes there is as below


#12

@mariarichy share your code with us.


#13

Please check my code,


#14

you seem to have a mistake in the brackets of your function call digitalRead(4,output);
another point which im not sure about is javascript is case sensitive , So just in case use the same case for both the id attribute of the span and the parameter of the function( lower case ‘output’ in both places)


#15

Tried changing the above said, still the same error continues!


#16

Hi, the correct syntax is

Note output needs to be surrounded by double quotes identifying it as a string and the entire function needs to be surrounded by single quote.


#17

Hey Naik,

I tried that too, the error says for the below code “Uncaught SyntaxError: Unexpected token }”

 
 
 
BOLT

 
 
 
 

Sensor Data

Read Pin

#18

@PPV Just adding the code between “pre” tag is working, for reference you can check the below page…:slight_smile:!

How do I Display HTML code on Web Page?
12 Answers


#19

onclick="digitalRead(4,“output”);

change to

onclick=‘digitalRead(4,“output”);’

As i mentioned earlier the digitalRead(4,“output”); needs to be surrounded by a single quote


#20

Sir, I have a very important query . As i am an ece student i have little knowledge of the xml , javascript.I was goiung through the bolt.js file in the sd card reading the back end code .Usually i write the microcontroller code in embedded C ,but when i saw the bolt.js script it was all written in the xml and java script .So my request is **can you kindly explain what exactly is written in the script and the UPLOAD file of the sd card ** Its very serious and important to me as i am a newbie to web dev and would like you to share your knowledge .
THANKYOU!