Electronic Components Datasheet Search
  English  ▼

X  

DEV-12887 Datasheet(PDF) 23 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) 23 Page - SparkFun Electronics

Back Button DEV-12887 Datasheet HTML 19Page - SparkFun Electronics DEV-12887 Datasheet HTML 20Page - SparkFun Electronics DEV-12887 Datasheet HTML 21Page - SparkFun Electronics DEV-12887 Datasheet HTML 22Page - SparkFun Electronics DEV-12887 Datasheet HTML 23Page - SparkFun Electronics DEV-12887 Datasheet HTML 24Page - SparkFun Electronics DEV-12887 Datasheet HTML 25Page - SparkFun Electronics DEV-12887 Datasheet HTML 26Page - SparkFun Electronics DEV-12887 Datasheet HTML 27Page - SparkFun Electronics Next Button
Zoom Inzoom in Zoom Outzoom out
 23 / 40 page
background image
/* Electric Imp Web­controlled LEDs 
    by: Jim Lindblom 
    SparkFun Electronics 
    date: November 1, 2013 
    license: Beerware. Please use, reuse, and modify this cod
e. 
    If you find it useful, buy me a beer some day! 
    This is a simple Electric Imp example, which shows how to 
interface 
    the imp with an agent and webpage. This example code goes 
hand­in­hand with  
    an HTML webpage. Check out this page for more informatio
n:  
    https://learn.sparkfun.com/tutorials/electric­imp­breakout
­hookup­guide/example­2­web­control 
    This will show how you can use html color, text, and radi
o form inputs 
    to control LEDs on/off, PWM them, and set a timer to turn 
them off. 
    Circuit: 
    A common cathode RGB LED is connected to the imp's pins 
1, 2, and 5. 
    The red anode connects to 1 through a 47 Ohm resistor, gre
en 2, and blue 5. 
    The cathode of the LED connects to ground. 
    Another simple, red LED is connected to the imp to imp pi
n 9, through 
    another 47 Ohm resistor. The cathode of the LED is grounde
d. 
*/
imp.configure("LED Web Control", [], []); // Configure the imp
///////////////
// Pin Setup //
///////////////
// Setup reference variables for our pins:
redPin <­ hardware.pin1;   // R of RGB
greenPin <­ hardware.pin2; // G of RGB
bluePin <­ hardware.pin5;  // B of RGB
ledPin <­ hardware.pin9;   // Lonely red LED
// Configure our pins:
ledPin.configure(DIGITAL_OUT);        // Simple digital output
redPin.configure(PWM_OUT, 0.01, 0);   // PWM output 10ms cloc
k, off
greenPin.configure(PWM_OUT, 0.01, 0); // PWM output 10ms cloc
k, off
bluePin.configure(PWM_OUT, 0.01, 0);  // PWM output 10ms cloc
k, off
/////////////////////////////////
// Agent Function Declarations //
/////////////////////////////////
// setLed will turn the lonely red LED on or off.
// This function will be called by the agent.
function setLed(ledState) 
{ 
    ledPin.write(ledState);
} 
// setRGB will take a table input, and set the RGB LED accordi
Page 23 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