Want to give specific input to some pins and want voltage out put from other pins

i want to design a circuit using bolt so that i can give some fixed value of resistance or voltage or current between two pins of bolt card and can find output from other pins in form of voltage output.
can some one provide coding for such purpose.

ajay gupta


You can read Voltage on the analog Pins of Bolt and give an equivalent output on the analogWrite or PWM pins of Bolt which are 1,2,3,4 and 5.

A sample code would be

function analogRead(pin,element_id) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { //document.getElementById(element_id).innerHTML = xmlhttp.responseText; if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { //document.getElementById("javascript_response").innerHTML = "Javascript Response : "+xmlhttp.responseText; var obj = JSON.parse(xmlhttp.responseText); if(obj.success=="1") { document.getElementById(element_id).innerHTML = "Pin Val = "+obj.value; var scaledValue = obj.value * (255/1023) //max value of analogWrite is 255 and max value of analogRead is 1023 analogWrite(1,scaledValue); //produce output voltage on pin 1 } else{ document.getElementById(element_id).innerHTML = "Error = "+xmlhttp.responseText; } } }; xmlhttp.open("GET","/analogRead?pin="+pin,true); xmlhttp.send(); }