120
CodeFreeze 2016 Making Innovation and Disruption Robert Gallup www.robertgallup.com © 2016 Robert Gallup

CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

CodeFreeze 2016

Making Innovation and Disruption Robert Gallup

www.robertgallup.com

© 2016 Robert Gallup

Page 2: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

HENRI MATISSE

IS PUTTING A LINE ROUND AN IDEADRAWING

Page 3: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

MAKING IS GIVING

FORMTO AN IDEA

Page 4: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery
Page 5: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery
Page 6: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

main() { printf (“Hello World!\n”); }

Page 7: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

WHY?

Page 8: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Make to Create

Page 9: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Make to Learn

Page 10: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Make to Communicate

Page 11: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Make to Inspire

Page 12: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Make to Inspire

Page 13: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Make to InspireMake to Innovate

Page 14: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Make to InspireMake to InnovateMake to Disrupt

Page 15: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

!Let’s Be Inspired

Page 16: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

BATTERY TOOL

JUMPER WIRE

BATTERY

LED (LIGHT)

MAKERS KIT

Page 17: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery
Page 18: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

POWER UP

Page 19: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

?

Page 20: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

I AM A MAKER

Page 21: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery
Page 22: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery
Page 23: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery
Page 24: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery
Page 25: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Maker Culture

Page 26: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

CURIOSITY

Page 27: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

FEARLESSNESS

Page 28: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

CREA

TIVI

TY

Page 29: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

COLLABORATION

Page 30: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

INDEPENDENCE

Page 31: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

VERSATILITY

Page 32: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

TENACITY

Page 33: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Democratization + Making

Page 34: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Democratized Technology

Page 35: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Democratized Technology

Open source hardware/software, Arduino, Raspberry Pi, Sparkfun, Adafruit, Tindie, Seeed, Shenzen

Page 36: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Democratized Manufacturing

Page 37: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Democratized Manufacturing

3D printing, small batch PCB services, laser cutting, CNC, Makerspaces, OSHPark

Page 38: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Democratized Funding

Page 39: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Democratized Funding

Kickstarter, Crowd Supply, crowd funded equity

Page 40: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Democratized Markets

Page 41: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Democratized MarketseBay, Etsy, Tindie, Amazon

Page 42: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Democratized Learning

Page 43: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Democratized Learning

MOOCs, MIT open courseware, Khan Academy, Stack Overflow, Coursera, Skillshare, Udacity, Instructables, Google

Page 44: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Makers in Society

Page 45: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery
Page 46: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Makers in SocietyMakers in Business

Page 47: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Makers in SocietyMakers in BusinessMakers in Education

Page 48: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

HOW MANY MAKERS ARE THERE IN THE WORLD?

Page 49: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

HOW MANY MAKERS ARE THERE IN THE WORLD?7.3 BILLION

Page 50: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

ARE YOU A MAKER ?

Page 51: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

?

Page 52: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

WARM COLD ?

Page 53: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery
Page 54: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

LIG

HTB

LUE®

BEA

N

REFE

REN

CE

Page 55: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

MICROCONTROLLER

A microcontroller runs firmware, and senses and controls voltages

Page 56: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

COLOR LED

RGB LED controlled

by the Bean

Page 57: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

TEMPERATURE + ACCELEROMETER

Temperature sensor and 3-axis accelerometer

Page 58: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

BLUETOOTH BLE / Bluetooth Smart module for connecting with other devices

Page 59: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

EXTERNAL CONNECTIONS

Connection points for power, sensing and control

Page 60: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

PROTOTYPING AREA

Convenient for adding additional components

Page 61: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

COLOR LED

BLUETOOTH

TEMPERATURE SENSORACCELEROMETER

MICRO-CONTROLLER

EXTERNAL CONNECTIONS

LIG

HTB

LUE®

BEA

N

REFE

REN

CE

(ARDUINO COMPATIBLE)

Page 62: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

DIY

Page 63: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

RESET VERY USEFUL TO KNOW

Page 64: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

PROGRAMMING YOUR BEAN

Bean Loader

WORKFLOW 1. Launch Bean Loader 2. Pair with your Bean 3. Upload a sketch 4. Edit

Page 65: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

LAUNCH BEAN LOADER

ANDROID IOS

Page 66: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

1 X LIGHTBLUE® BEAN

1 X LED (LIGHT EMITTING DIODE)

1 X JUMPER WIRE

1 X SPARE BATTERY

1 X BATTERY TOOL

MAKING INNOVATION AND DISRUPTION

MAKER KIT1 X LIGHTBLUE® BEAN

1 X LED (LIGHT EMITTING DIODE)

1 X JUMPER WIRE

1 X SPARE BATTERY

1 X BATTERY TOOL

MAKING INNOVATION AND DISRUPTION

BEAN NAME

MAKER KIT

actBean

BEAN NAME

BEAN NAME

Bean

MAKING INNOVATION AND DISRUPTION

MAKER KIT1 X LIGHTBLUE® BEAN

1 X LED (LIGHT EMITTING DIODE)

1 X JUMPER WIRE

1 X SPARE BATTERY

1 X BATTERY TOOL

adoptionBean

1 X LIGHTBLUE® BEAN

1 X LED (LIGHT EMITTING DIODE)

1 X JUMPER WIRE

1 X SPARE BATTERY

1 X BATTERY TOOL

MAKING INNOVATION AND DISRUPTION

BEAN NAME

MAKER KIT

advertisingBean

1 X LIGHTBLUE® BEAN

1 X LED (LIGHT EMITTING DIODE)

1 X JUMPER WIRE

1 X SPARE BATTERY

1 X BATTERY TOOL

MAKING INNOVATION AND DISRUPTION

BEAN NAME

MAKER KIT

aidBean

1 X LIGHTBLUE® BEAN

1 X LED (LIGHT EMITTING DIODE)

1 X JUMPER WIRE

1 X SPARE BATTERY

1 X BATTERY TOOL

MAKING INNOVATION AND DISRUPTION

BEAN NAME

MAKER KIT

alarmBean

1 X LIGHTBLUE® BEAN

1 X LED (LIGHT EMITTING DIODE)

1 X JUMPER WIRE

1 X SPARE BATTERY

1 X BATTERY TOOL

MAKING INNOVATION AND DISRUPTION

BEAN NAME

MAKER KIT

allyBean

1 X LIGHTBLUE® BEAN

1 X LED (LIGHT EMITTING DIODE)

1 X JUMPER WIRE

1 X SPARE BATTERY

1 X BATTERY TOOL

MAKING INNOVATION AND DISRUPTION

BEAN NAME

MAKER KIT

ampleBean

UNIQUE BEAN NAME

Page 67: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

PAIR YOUR BEAN (ANDROID)

DONESELECT BLUETOOTH

1SELECT YOUR BEAN

2

Page 68: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

PAIR YOUR BEAN (iOS)

DONESELECT A SKETCH

1SELECT BLUETOOTH

2SELECT YOUR BEAN

3

Page 69: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

UPLOAD TO BEAN (ANDROID)

CHOOSE SKETCH…

1NAVIGATE TO SKETCH

2UPLOAD

3COMPILES AND UPLOADS

Page 70: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

UPLOAD TO BEAN (iOS)

SELECT A SKETCH

1SELECT UPLOAD

2COMPILES AND UPLOADS

Page 71: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

A_BEANBLINK//BlinkBeanLEDvoidsetup(){}

voidloop(){//TurnLEDONBean.setLed(150,0,0);Bean.sleep(300);

//TurnLEDOFFBean.setLed(0,0,0);Bean.sleep(300);}

Page 72: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

PROGRAM SKETCH STRUCTURE

//BlinkBeanLEDvoidsetup(){

}

voidloop(){

}

Runs Once

Repeats Infinitely

Comment

Statements (C/C++)

Page 73: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

RED, GREEN, BLUE (0-255)FUNCTION

Bean.setLED (r, g, b);

Page 74: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

TIME TO SLEEP (MILLISECONDS)FUNCTION

Bean.sleep (time);

Page 75: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

EDIT SKETCH (ANDROID)

LAUNCH DROID EDIT

1NAVIGATE TO SKETCH

2SAVE + CONTINUEEDIT SKETCH

3 4

Page 76: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

EDIT SKETCH IN BEAN LOADER

EDIT SKETCH (iOS)

Page 77: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

MAKE BREAK

Page 78: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

B_BEANBADGEvoidsetup(){}

voidloop(){//BlinkONColor#1Bean.setLed(150,0,0);Bean.sleep(1000);

//BlinkONColor#2Bean.setLed(0,150,0);Bean.sleep(1000);

//BlinkONColor#3Bean.setLed(0,0,150);Bean.sleep(1000);

//BlinkOFFBean.setLed(0,0,0);Bean.sleep(1000);}

Page 79: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

MAKE BREAK

Page 80: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

C_BEANTEMPERATUREinttemperature;intblinkDelay;

voidsetup(){}

voidloop(){

temperature=Bean.getTemperature();

//Blinkdelaydependsontemperatureif(temperature<26){blinkDelay=600;}else{blinkDelay=100;}Bean.setLed(0,150,0);Bean.sleep(blinkDelay);Bean.setLed(0,0,0);Bean.sleep(blinkDelay);

}

Page 81: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

VARIABLES

TYPE NAME

int temperature;

Variables store values for use in a sketch. Variable type is required. Variable scope is determined by the location of declaration.

inttemperature;intblinkDelay;

Page 82: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Bean.getTemperature ();Returns the current temperature in degrees Celsius Other LightBlue® Bean peripherals, such as as the LED and accelerometer, are available through this same mechanism.

Page 83: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

If statements are used for branching. The usual logical operators are supported: ==,<, >, <=, >=, !=

if(temperature<26){blinkDelay=600;}else{blinkDelay=100;}

BRANCHING

Page 84: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

MAKE BREAK

Page 85: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

electronics

Page 86: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Most of us are familiar with the idea of voltage.

POSITIVE

NEGATIVE

Page 87: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

CURRENT

VOLTAGE DRIVES CURRENT

Page 88: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

BUT, NOT WITHOUT A CIRCUIT

+CURRENT

Page 89: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

BATTERY LED

COMPONENTS

+

Page 90: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

+This is a Schematic

Page 91: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

INPUTS & OUTPUTS

INPUT

OUTPUTMICROCONTROLLER

Page 92: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

PINS A0, A1 PINS 0-5 ANALOG DIGITAL

Page 93: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

PINS A0, A1 PINS 0-5 ANALOG DIGITAL

BOOLEANINTEGER

Page 94: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

OUTPUT

Page 95: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

LED

GN

DPIN

5

Page 96: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

PIN

SIMPLE LED CIRCUIT

Page 97: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

D_OUTPUTvoidsetup(){//Initializepin#5asan//outputpinpinMode(5,OUTPUT);

}

voidloop(){

//Setexternalpinvoltageto//HIGH,thenLOWtocause//blinkingdigitalWrite(5,HIGH);Bean.sleep(500);digitalWrite(5,LOW);Bean.sleep(500);

}

Page 98: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

pinMode (5, OUTPUT);Sets pin #5 to be an output pin. That allows the microcontroller to set the pin voltage to high or low. Pin number can range from 0-5. Other modes are INPUT, and INPUT_PULLUP.

Page 99: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

digitalWrite (5, HIGH);Sets pin #5 to either “HIGH”, or “LOW”. Pin number can range from 0-5. The pinMode() must be set to OUTPUT for this pin.

Page 100: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

INPUT

Page 101: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

GN

DPI

N 0

Page 102: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

SIMPLE BUTTON CIRCUIT

PIN

GND

Page 103: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

PIN VOLTAGE WITH BUTTON

HIGH

0V

Page 104: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

E_INPUTvoidsetup(){

//Initializepin#0asan//inputpin(withdefault//HIGHvoltage)pinMode(0,INPUT_PULLUP);

}

voidloop(){//TurntheBean'sLEDon.//Colordependsonthestate//ofpin#0if(digitalRead(0)==HIGH){Bean.setLed(200,0,0);}else{Bean.setLed(0,200,0);}Bean.sleep(1000);

//TurntheLEDoffBean.setLed(0,0,0);Bean.sleep(1000);

}

Page 105: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

pinMode (0, INPUT_PULLUP);Sets pin #0 to be an input pin. By default, the pin shows a high voltage. In order to create a low voltage, the pin must be connected to ground by some method. Pin number can range from 0-5. Other pin modes are INPUT, and OUTPUT.

Page 106: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

digitalRead (0);Returns a value of HIGH or LOW depending on the circuit connected to pin #0. In our case, the value will be HIGH by default, then change to LOW when the wire switch is connected.

Page 107: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

X_BEANDEMO//Variables

//PinforreadingmotionresetconstbyteMOTION_RESET_PIN=0;constbyteEXTERNAL_LED_PIN=5;

//AccelerometermonitoringconstintMOTION_THRESHOLD=100;AccelerationReadingcurrentReading;AccelerationReadingpreviousReading;intmotion;

//Temperature(celsius)constintLOW_TEMPERATURE=24;constintHIGH_TEMPERATURE=32;constfloatTEMPERATURE_RANGE=(HIGH_TEMPERATURE-LOW_TEMPERATURE);inttemperature;

//SampleandblinkintervalsintsampleCount;intsampleInterval;intblinkCount;

//LEDStatebooleanlightOn;

//InteractionstatesbooleanmotionDetected;booleanwasReset;

//LEDColorconstbyteMAX_COLOR=200;bytered=0;bytegreen=0;byteblue=0;

voidsetup(){

motionDetected=false;lightOn=true;sampleCount=0;sampleInterval=250;blinkCount=2;

wasReset=false;previousReading=Bean.getAcceleration();

//Setmodesforresetand//externalLEDpinspinMode(MOTION_RESET_PIN,INPUT_PULLUP);pinMode(EXTERNAL_LED_PIN,OUTPUT);digitalWrite(EXTERNAL_LED_PIN,LOW);}

voidloop(){

//Checkthetemperature,updateLEDcolor//(greenisalwayszero)temperature=Bean.getTemperature();if(temperature<LOW_TEMPERATURE)temperature=LOW_TEMPERATURE;if(temperature>HIGH_TEMPERATURE)temperature=HIGH_TEMPERATURE;

//Calculatecolorvaluesfromtemperaturered=MAX_COLOR*(float(temperature-LOW_TEMPERATURE)/TEMPERATURE_RANGE);blue=MAX_COLOR*(float(HIGH_TEMPERATURE-temperature)/TEMPERATURE_RANGE);//ChecktheaccelerometerandcalculatemotioncurrentReading=Bean.getAcceleration();intdeltaX=abs(currentReading.xAxis-previousReading.xAxis);intdeltaY=abs(currentReading.yAxis-previousReading.yAxis);intdeltaZ=abs(currentReading.zAxis-previousReading.zAxis);motion=deltaX+deltaY+deltaZ;previousReading=currentReading;

//Updatestatebasedonmotionif(motion>MOTION_THRESHOLD)motionDetected=true;

//ResettheblinkstateifRESET_MOTION_PINis//shortedtogroundif(digitalRead(MOTION_RESET_PIN)==LOW){motionDetected=false;lightOn=true;wasReset=true;}

//Updateblinkstate--sampleCount;if(sampleCount<=0){sampleCount=blinkCount;lightOn=!lightOn;}

//UpdatethemotiondetectorLEDif(!motionDetected||(lightOn&motionDetected)){Bean.setLed(red,green,blue);}else{Bean.setLed(0,0,0);}

//Updatetheresetindicatorif(lightOn&&wasReset){digitalWrite(EXTERNAL_LED_PIN,HIGH);}else{digitalWrite(EXTERNAL_LED_PIN,LOW);}

//PuttheBeantosleepuntilthenextloopBean.sleep(sampleInterval);

}

FEATURES Starts with solid LED

Motion detector blinks when moved Switch on Pin #0 resets motion detector LED on Pin #5 indicates that motion has

been detected at least once

Page 108: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Wax On. Wax Off.

Page 109: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

MAKERS

+This is a Schematic

Page 110: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

DIGITALANALOG

I²C SPI

Shock switch Knock sensor Infrared transmitter Laser Transmitter Reed switch Mini Reed Infrared-receiver Button Photo-interrupter Tilt-switch Mercury switch Temperature Sensor Rotary Encoder Photoresistor Humidity Sensor Obstacle Sensor Tracking Sensor Microphone Touch Sensor Flame Sensor

The Bean supports easy connection to a universe of sensors and other

devices like displays, motors, GPS modules, and buzzers.

SENSORS, DISPLAYS,

AND MORE

Page 111: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

SMART PHONE HUBA mobile device connected with a Bean can be a hub for collecting data, providing a user interface, connecting to the cloud and controlling the Bean. Punch Through has published iOS and Android libraries.

Page 112: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

LAPTOP HUBA BLE-compatible laptop can also be a hub communicating with the Bean. It can connect to the internet and provides a more robust development environment.

Page 113: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

IoT + NODE-REDOpen source graphical programming environment built on node.js. Connecting modules defines behavior and actions. Bean nodes are available. See the Bean website for more information.

Page 114: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

LightBlue | Bean+Rechargeable LiPo Battery

Standard Headers for Add-on Boards Grove Connectors for Easy Prototyping

3.3V / 5V Operation

PunchThroughwww.punchthrough.com

Page 115: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

PROJECTS?Wearable Bicycle Navigator Hack your Coffee Pot or Kegorator Phone-Controlled Mood Light

hackster.io instructables.com

Page 116: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

ARE YOU A MAKER ?

Page 117: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

Thank You!

Page 118: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

USEFUL APPS

LIGHTBLUE EXPLORER (iTunes) General tool for working with BLE. Can control the Bean LED and shows accelerometer and external I/O

https://itunes.apple.com/us/app/lightblue-explorer-bluetooth/id557428110?mt=8

BEAN CONSOLE (iTunes)Allows you to monitor Serial I/O with a Bean. Very handy for prototyping and debugging

https://itunes.apple.com/us/app/bean-console/id982751969?ls=1&mt=8

Page 119: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

ONLINE RESOURCESPUNCH THROUGH punchthrough.com, all things LightBlue Bean, guides, forums ARDUINO arduino.cc, reference, tutorials

INSTRUCTABLES instructables.com, projects HACKSTER.IO hackster.io, projects MAKE MAGAZINE makezine.com, articles, tutorials, reviews MAKER SHED makershed.com, components, kits, stuff SPARKFUN sparkfun.com, components, devices, tutorials ADAFRUIT adafruit.com, components, devices, tutorials

AMAZON amazon.com, books, components, devices O’REILLY oreilly.com, reference, books

GOOGLE google.com,everything

Page 120: CodeFreeze 2016 Making Innovation and Disruption · making innovation and disruption maker kit 1 x lightblue® bean 1 x led (light emitting diode) 1 x jumper wire 1 x spare battery

BEAN PINOUT - COMPLETE