Electronic Components Datasheet Search
  English  ▼

X  

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

Back Button DEV-12887 Datasheet HTML 12Page - SparkFun Electronics DEV-12887 Datasheet HTML 13Page - SparkFun Electronics DEV-12887 Datasheet HTML 14Page - SparkFun Electronics DEV-12887 Datasheet HTML 15Page - SparkFun Electronics DEV-12887 Datasheet HTML 16Page - SparkFun Electronics DEV-12887 Datasheet HTML 17Page - SparkFun Electronics DEV-12887 Datasheet HTML 18Page - SparkFun Electronics DEV-12887 Datasheet HTML 19Page - SparkFun Electronics DEV-12887 Datasheet HTML 20Page - SparkFun Electronics Next Button
Zoom Inzoom in Zoom Outzoom out
 16 / 40 page
background image
/* Hello, Blink 
   by: Jim Lindblom 
   SparkFun Electronics 
   date: October 31, 2013  
   license: Beerware. Use, reuse, and modify this code howeve
r you see fit. 
   If you find it useful, buy me a beer some day! 
   This is an Electric Imp hello, world blink sketch. It'll bl
ink an LED 
   connected to pin 1, once every second. 
*/
////////////////////////////////////////
// Global Variables                   //
////////////////////////////////////////
ledState <­ 0;
////////////////////////////////////////
// Function definitions               //
////////////////////////////////////////
// Loop constantly updates the LED. If ledState is 1, we'll tu
rn the LED on and
// set ledState to 0. Vice­versa is ledState is 0 coming in. T
his function 
// schedules a wakeup in 1 second, and calls itself again.
function loop()
{ 
if (ledState)
    { 
        hardware.pin1.write(1); // Write pin 1 high
        ledState =0; // Flip ledState
    } 
else
    { 
        hardware.pin1.write(0); // Write pin 1 low
        ledState =1; // Flip ledState
    } 
// This must be called at the end. This'll call loop() aga
in in 1s, that way
// it'll actually loop!
    imp.wakeup(1.00, loop); 
} 
////////////////////////////////////////
// Setup Stuff: Runs first at startup //
////////////////////////////////////////
hardware.pin1.configure(DIGITAL_OUT);   // Configure Pin 1 as 
digital output
loop(); // Call loop, and let the program go!
Then hit the >Build and Run button up top, and enjoy the blinks.
Shortcut heads up! If you’re a neurotic CTRL+S saver, the standard save
shortcut does save, but it also attempts to build and run your code. If
successful, it’ll upload the code and immediately start running on your imp.
If there’s an error, you’ll start hearing about it in the log window.
Into the Code
Page 16 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