전자부품 데이터시트 검색엔진
  Korean  ▼
ALLDATASHEET.CO.KR

X  

DEV-12887 데이터시트(PDF) 33 Page - SparkFun Electronics

부품명 DEV-12887
상세설명  Electric Imp Breakout Hookup Guide
PDF  40 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
제조업체  SPARKFUN [SparkFun Electronics]
홈페이지  https://www.sparkfun.com/
Logo SPARKFUN - SparkFun Electronics

DEV-12887 데이터시트(HTML) 33 Page - SparkFun Electronics

Back Button DEV-12887 Datasheet HTML 29Page - SparkFun Electronics DEV-12887 Datasheet HTML 30Page - SparkFun Electronics DEV-12887 Datasheet HTML 31Page - SparkFun Electronics 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 Next Button
Zoom Inzoom in Zoom Outzoom out
 33 / 40 page
background image
        pin1 = hardware.pin1.read(),
        pin2 = hardware.pin2.read(),
        pin5 = hardware.pin5.read(),
        pin7 = hardware.pin7.read(),
        pin8 = hardware.pin8.read(),
        pin9 = hardware.pin9.read(),
        voltage = hardware.voltage()    // We'll also send th
e operating voltage.
    } 
// Once the table is constructed, send it out to the agen
t with "impValues"
// as the identifier.
    agent.send("impValues", pinValues);
// Schedule a wakeup in 100ms, with a callback to this fun
ction.
    imp.wakeup(0.1, sendPins);
} 
sendPins(); // Call sendPins once, and let it do the rest of t
he work.
Per usual, check out the code comments for a line-by-line overview of
what’s going on. The new function this time?
agent.send(string, object) . agent.send is used to send data from the
imp, to the agent. This time we need to create a handler on the agent side
to deal with the data sent by the imp.
Speaking of agent code…
The Agent Code
On the agent side we need to accomplish two tasks:
1. Define an imp handler function to deal with the data sent by the imp.
We’ll just store the data sent by the imp into a global variable.
2. Create another handler to be called when an HTTP request is
received. Upon receiving the request the agent will construct a
response based on the data received from the imp, and send that out
to the requester.
There’s the overview, here’s the code. Copy and paste this into the Agent
half of your model:
Page 33 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


데이터시트 다운로드

Go To PDF Page


링크 URL



ALLDATASHEET 가 귀하에 도움이 되셨나요?  [ DONATE ] 

Alldatasheet는?   |   광고문의   |   운영자에게 연락하기   |   개인정보취급방침   |   링크 투 데이터시트    |   링크교환   |   제조사별 검색
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