Electronic Components Datasheet Search
  English  ▼

X  

DEV-12887 Datasheet(PDF) 37 Page - SparkFun Electronics

Part # DEV-12887
Description  Electric Imp Breakout Hookup Guide
PDF  40 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  SPARKFUN [SparkFun Electronics]
Direct Link  https://www.sparkfun.com/
Logo SPARKFUN - SparkFun Electronics

DEV-12887 Datasheet(HTML) 37 Page - SparkFun Electronics

Back Button DEV-12887 Datasheet HTML 32Page - SparkFun Electronics DEV-12887 Datasheet HTML 33Page - SparkFun Electronics DEV-12887 Datasheet HTML 34Page - SparkFun Electronics DEV-12887 Datasheet HTML 35Page - SparkFun Electronics DEV-12887 Datasheet HTML 36Page - SparkFun Electronics DEV-12887 Datasheet HTML 37Page - SparkFun Electronics DEV-12887 Datasheet HTML 38Page - SparkFun Electronics DEV-12887 Datasheet HTML 39Page - SparkFun Electronics DEV-12887 Datasheet HTML 40Page - SparkFun Electronics  
Zoom Inzoom in Zoom Outzoom out
 37 / 40 page
background image
<html>
<head>
<title>Electric Imp Breakout</title>
<script src="http://code.jquery.com/jquery­1.9.1.min.js">
</script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mo
bile­1.3.1.min.js"></script>
<script>
        $( function() {   
// Edit these values first! The externalURL variab
le should be the
// unique URL of your agent. e.g. the last part o
f:
// https://agent.electricimp.com/UpyYpRLmBB7m
// pollRate defines how often the values on your p
age will refresh.
var externalURL ="UpyYpRLmBB7m";
var pollRate ="1000";
function poll(){
// Construct an ajax() GET request.
// http://www.w3schools.com/jquery/ajax_ajax.a
sp
                $.ajax({
                    type: "get",
                    url: "https://agent.electricimp.com/"+exte
rnalURL,  // URL of our imp agent. 
                    dataType: "json",   // Expect JSON­formatt
ed response from agent.
                    success: function(agentMsg) {   // Functio
n to run when request succeeds.
// jQuery find "pin1" id and overwrit
e its data with "pin1" key value in agentMsg
                        $("#pin1").html(agentMsg.pin
1);              
                        $("#pin2").html(agentMsg.pin2);
                        $("#pin5").html(agentMsg.pin5);
                        $("#pin7").html(agentMsg.pin7);
                        $("#pin8").html(agentMsg.pin8);
                        $("#pin9").html(agentMsg.pin9);
                        $("#vin").html(agentMsg.voltage);
updateBG(agentMsg.pin5);    // Try thi
s if you have a photocell connected to pin 5
                    }, 
                    error: function(err) {
                        console.log("err"+ err.status)
                    } 
                }); 
            } 
// setInterval is Javascript method to call a func
tion at a specified interval.
// http://www.w3schools.com/jsref/met_win_setinter
val.asp
setInterval(function(){ poll(); }, pollRate);
// This function updates the 
function updateBG(lightSensor)
            { 
if (lightSensor > 30000)
                { 
Page 37 of 40



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com