code freeze 2016: making innovation and disruption

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

Upload: robertgallup

Post on 22-Jan-2018

251 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Code Freeze 2016: Making Innovation and Disruption

CodeFreeze 2016

Making Innovation and Disruption Robert Gallup

www.robertgallup.com

© 2016 Robert Gallup

Page 2: Code Freeze 2016: Making Innovation and Disruption

HENRI MATISSE

IS PUTTING A LINE ROUND AN IDEADRAWING

Page 3: Code Freeze 2016: Making Innovation and Disruption

MAKING IS GIVING

FORMTO AN IDEA

Page 4: Code Freeze 2016: Making Innovation and Disruption
Page 5: Code Freeze 2016: Making Innovation and Disruption
Page 6: Code Freeze 2016: Making Innovation and Disruption

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

Page 7: Code Freeze 2016: Making Innovation and Disruption

WHY?

Page 8: Code Freeze 2016: Making Innovation and Disruption

Make to Create

Page 9: Code Freeze 2016: Making Innovation and Disruption

Make to Learn

Page 10: Code Freeze 2016: Making Innovation and Disruption

Make to Communicate

Page 11: Code Freeze 2016: Making Innovation and Disruption

Make to Inspire

Page 12: Code Freeze 2016: Making Innovation and Disruption

Make to Inspire

Page 13: Code Freeze 2016: Making Innovation and Disruption

Make to InspireMake to Innovate

Page 14: Code Freeze 2016: Making Innovation and Disruption

Make to InspireMake to InnovateMake to Disrupt

Page 15: Code Freeze 2016: Making Innovation and Disruption

!Let’s Be Inspired

Page 16: Code Freeze 2016: Making Innovation and Disruption

BATTERY TOOL

JUMPER WIRE

BATTERY

LED (LIGHT)

MAKERS KIT

Page 17: Code Freeze 2016: Making Innovation and Disruption
Page 18: Code Freeze 2016: Making Innovation and Disruption

POWER UP

Page 19: Code Freeze 2016: Making Innovation and Disruption

?

Page 20: Code Freeze 2016: Making Innovation and Disruption

I AM A MAKER

Page 21: Code Freeze 2016: Making Innovation and Disruption
Page 22: Code Freeze 2016: Making Innovation and Disruption
Page 23: Code Freeze 2016: Making Innovation and Disruption
Page 24: Code Freeze 2016: Making Innovation and Disruption
Page 25: Code Freeze 2016: Making Innovation and Disruption

Maker Culture

Page 26: Code Freeze 2016: Making Innovation and Disruption

CURIOSITY

Page 27: Code Freeze 2016: Making Innovation and Disruption

FEARLESSNESS

Page 28: Code Freeze 2016: Making Innovation and Disruption

CREA

TIVI

TY

Page 29: Code Freeze 2016: Making Innovation and Disruption

COMMUNITY

Page 30: Code Freeze 2016: Making Innovation and Disruption

INDEPENDENCE

Page 31: Code Freeze 2016: Making Innovation and Disruption

VERSATILITY

Page 32: Code Freeze 2016: Making Innovation and Disruption

TENACITY

Page 33: Code Freeze 2016: Making Innovation and Disruption

Democratization + Making

Page 34: Code Freeze 2016: Making Innovation and Disruption

Democratized Technology

Open Source Hardware+Software Arduino Raspberry Pi

Sparkfun Adafruit Tindie Seeed

Page 35: Code Freeze 2016: Making Innovation and Disruption

Democratized Manufacturing

3D Printing Small-batch PCB Laser Cutting

CNC Makerspaces OSHPark

Page 36: Code Freeze 2016: Making Innovation and Disruption

Democratized FundingKickstarter Crowd Supply Crowd funded equity

Page 37: Code Freeze 2016: Making Innovation and Disruption

Democratized MarketseBay Etsy Tindie Amazon

Page 38: Code Freeze 2016: Making Innovation and Disruption

Democratized Learning

MOOC MIT Open Courseware Khan Academy Stack Overflow

Coursera Udacity Instructables Google

Page 39: Code Freeze 2016: Making Innovation and Disruption

Makers in Society

Page 40: Code Freeze 2016: Making Innovation and Disruption
Page 41: Code Freeze 2016: Making Innovation and Disruption

Makers in SocietyMakers in Business

Page 42: Code Freeze 2016: Making Innovation and Disruption

Makers in SocietyMakers in BusinessMakers in Education

Page 43: Code Freeze 2016: Making Innovation and Disruption

HOW MANY MAKERS ARE THERE IN THE WORLD?

Page 44: Code Freeze 2016: Making Innovation and Disruption

HOW MANY MAKERS ARE THERE IN THE WORLD?7.3 BILLION

Page 45: Code Freeze 2016: Making Innovation and Disruption

ARE YOU A MAKER ?

Page 46: Code Freeze 2016: Making Innovation and Disruption

?

Page 47: Code Freeze 2016: Making Innovation and Disruption

WARM COLD ?

Page 48: Code Freeze 2016: Making Innovation and Disruption
Page 49: Code Freeze 2016: Making Innovation and Disruption

LIG

HTB

LUE®

BEA

N

REFE

REN

CE

Page 50: Code Freeze 2016: Making Innovation and Disruption

MICROCONTROLLER

A microcontroller runs firmware, and senses and controls voltages

Page 51: Code Freeze 2016: Making Innovation and Disruption

COLOR LED

RGB LED controlled

by the Bean

Page 52: Code Freeze 2016: Making Innovation and Disruption

TEMPERATURE + ACCELEROMETER

Temperature sensor and 3-axis accelerometer

Page 53: Code Freeze 2016: Making Innovation and Disruption

BLUETOOTH BLE / Bluetooth Smart module for connecting with other devices

Page 54: Code Freeze 2016: Making Innovation and Disruption

EXTERNAL CONNECTIONS

Connection points for power, sensing and control

Page 55: Code Freeze 2016: Making Innovation and Disruption

PROTOTYPING AREA

Convenient for adding additional components

Page 56: Code Freeze 2016: Making Innovation and Disruption

COLOR LED

BLUETOOTH

TEMPERATURE SENSORACCELEROMETER

MICRO-CONTROLLER

EXTERNAL CONNECTIONS

LIG

HTB

LUE®

BEA

N

REFE

REN

CE

(ARDUINO COMPATIBLE)

Page 57: Code Freeze 2016: Making Innovation and Disruption

DIY

Page 58: Code Freeze 2016: Making Innovation and Disruption

RESET VERY USEFUL TO KNOW

Page 59: Code Freeze 2016: Making Innovation and Disruption

PROGRAMMING YOUR BEAN

Bean Loader

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

Page 60: Code Freeze 2016: Making Innovation and Disruption

LAUNCH BEAN LOADER

ANDROID IOS

Page 61: Code Freeze 2016: Making Innovation and Disruption

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 62: Code Freeze 2016: Making Innovation and Disruption

PAIR YOUR BEAN (ANDROID)

DONESELECT BLUETOOTH

1

SELECT YOUR BEAN

2

Page 63: Code Freeze 2016: Making Innovation and Disruption

PAIR YOUR BEAN (iOS)

DONESELECT A SKETCH

1SELECT BLUETOOTH

2SELECT YOUR BEAN

3

Page 64: Code Freeze 2016: Making Innovation and Disruption

UPLOAD TO BEAN (ANDROID)

CHOOSE SKETCH…

1

NAVIGATE TO SKETCH

2UPLOAD

3COMPILES AND UPLOADS

Page 65: Code Freeze 2016: Making Innovation and Disruption

UPLOAD TO BEAN (iOS)

SELECT A SKETCH

1SELECT UPLOAD

2COMPILES AND UPLOADS

Page 66: Code Freeze 2016: Making Innovation and Disruption

A_BEANBLINK//BlinkBeanLEDvoidsetup(){}

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

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

Page 67: Code Freeze 2016: Making Innovation and Disruption

PROGRAM SKETCH STRUCTURE

//BlinkBeanLEDvoidsetup(){

}

voidloop(){

}

Runs Once

Repeats Infinitely

Comment

Statements (C/C++)

Page 68: Code Freeze 2016: Making Innovation and Disruption

RED, GREEN, BLUE (0-255)FUNCTION

Bean.setLED (r, g, b);

Page 69: Code Freeze 2016: Making Innovation and Disruption

TIME TO SLEEP (MILLISECONDS)FUNCTION

Bean.sleep (time);

Page 70: Code Freeze 2016: Making Innovation and Disruption

EDIT SKETCH (ANDROID)

LAUNCH DROID EDIT

1

NAVIGATE TO SKETCH

2SAVE + CONTINUEEDIT SKETCH

3 4

Page 71: Code Freeze 2016: Making Innovation and Disruption

EDIT SKETCH IN BEAN LOADER

EDIT SKETCH (iOS)

Page 72: Code Freeze 2016: Making Innovation and Disruption

MAKE BREAK

Page 73: Code Freeze 2016: Making Innovation and Disruption

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 74: Code Freeze 2016: Making Innovation and Disruption

MAKE BREAK

Page 75: Code Freeze 2016: Making Innovation and Disruption

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 76: Code Freeze 2016: Making Innovation and Disruption

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 77: Code Freeze 2016: Making Innovation and Disruption

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 78: Code Freeze 2016: Making Innovation and Disruption

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

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

BRANCHING

Page 79: Code Freeze 2016: Making Innovation and Disruption

MAKE BREAK

Page 80: Code Freeze 2016: Making Innovation and Disruption

electronics

Page 81: Code Freeze 2016: Making Innovation and Disruption

Most of us are familiar with the idea of voltage.

POSITIVE

NEGATIVE

Page 82: Code Freeze 2016: Making Innovation and Disruption

CURRENT

VOLTAGE DRIVES CURRENT

Page 83: Code Freeze 2016: Making Innovation and Disruption

BUT, NOT WITHOUT A CIRCUIT

+CURRENT

Page 84: Code Freeze 2016: Making Innovation and Disruption

BATTERY LED

COMPONENTS

+

Page 85: Code Freeze 2016: Making Innovation and Disruption

+This is a Schematic

Page 86: Code Freeze 2016: Making Innovation and Disruption

INPUTS & OUTPUTS

INPUT

OUTPUTMICROCONTROLLER

Page 87: Code Freeze 2016: Making Innovation and Disruption

PINS A0, A1 PINS 0-5 ANALOG DIGITAL

Page 88: Code Freeze 2016: Making Innovation and Disruption

PINS A0, A1 PINS 0-5 ANALOG DIGITAL

BOOLEANINTEGER

Page 89: Code Freeze 2016: Making Innovation and Disruption

OUTPUT

Page 90: Code Freeze 2016: Making Innovation and Disruption

LED

GN

DPIN

5

Page 91: Code Freeze 2016: Making Innovation and Disruption

PIN

SIMPLE LED CIRCUIT

Page 92: Code Freeze 2016: Making Innovation and Disruption

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

}

voidloop(){

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

}

Page 93: Code Freeze 2016: Making Innovation and Disruption

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 94: Code Freeze 2016: Making Innovation and Disruption

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 95: Code Freeze 2016: Making Innovation and Disruption

INPUT

Page 96: Code Freeze 2016: Making Innovation and Disruption

GN

DPI

N 0

Page 97: Code Freeze 2016: Making Innovation and Disruption

SIMPLE BUTTON CIRCUIT

PIN

GND

Page 98: Code Freeze 2016: Making Innovation and Disruption

PIN VOLTAGE WITH BUTTON

HIGH

0V

Page 99: Code Freeze 2016: Making Innovation and Disruption

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 100: Code Freeze 2016: Making Innovation and Disruption

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 101: Code Freeze 2016: Making Innovation and Disruption

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 102: Code Freeze 2016: Making Innovation and Disruption

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 103: Code Freeze 2016: Making Innovation and Disruption

Wax On. Wax Off.

Page 104: Code Freeze 2016: Making Innovation and Disruption

MAKERS

+This is a Schematic

Page 105: Code Freeze 2016: Making Innovation and Disruption

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 106: Code Freeze 2016: Making Innovation and Disruption

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 107: Code Freeze 2016: Making Innovation and Disruption

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 108: Code Freeze 2016: Making Innovation and Disruption

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 109: Code Freeze 2016: Making Innovation and Disruption

LightBlue | Bean+Rechargeable LiPo Battery

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

3.3V / 5V Operation

PunchThroughwww.punchthrough.com

Page 110: Code Freeze 2016: Making Innovation and Disruption

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

hackster.io instructables.com

Page 111: Code Freeze 2016: Making Innovation and Disruption

ARE YOU A MAKER ?

Page 112: Code Freeze 2016: Making Innovation and Disruption

Thank You!

www.robertgallup.com

Page 113: Code Freeze 2016: Making Innovation and Disruption

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 114: Code Freeze 2016: Making Innovation and Disruption

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