Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Getting started with the spark core
Search
claudiomettler
January 14, 2015
Technology
310
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Getting started with the spark core
For Hackware v0.3
claudiomettler
January 14, 2015
More Decks by claudiomettler
See All by claudiomettler
On-demand image scaling with AWS Lambda and S3
claudiomettler
0
170
Terraform in 5 minutes
claudiomettler
0
750
Intro to Xdebug
claudiomettler
0
250
chef talk at DevOps Singapore
claudiomettler
0
160
Other Decks in Technology
See All in Technology
LLMにもCAP定理があるという話
harukasakihara
0
330
連合学習と機密コンピューティング
lycorptech_jp
PRO
0
110
SONiCのLinuxベースを活かしたZabbix監視
sonic
0
140
【セミナー資料】Claude Code をセキュアに使うための考え方と設定の勘どころ / Claude Code Webinar 20260616
masahirokawahara
1
200
AIエージェントが名古屋の猛暑からあなたを守る
happysamurai294
0
110
2026TECHFRESH畢業分享會 - Lightning Talk - E起 See See : 電商推薦讀心術? 數據說了算
line_developers_tw
PRO
0
960
自律型AIエージェントは何を破壊するのか
kojira
0
160
GitHub Copilot 最新アップデート – 「一歩先」の実践活用術
moulongzhang
1
220
【NRUG vol.18】KubernetesにおけるNew Relicデータ取得量削減の考え方
nrug_member
0
110
非定型業務をAI slackbotで自動化する ~ 社内要望を自動壁打ちするbotを作った ~/automating-ad-hoc-work-with-ai-slackbot
shibayu36
0
650
MCP Appsを作ってみよう
iwamot
PRO
4
610
手塩にかけりゃいいってもんじゃない
ming_ayami
0
560
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Side Projects
sachag
455
43k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
170
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
200
Skip the Path - Find Your Career Trail
mkilby
1
150
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
The Cult of Friendly URLs
andyhume
79
6.9k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
So, you think you're a good person
axbom
PRO
2
2.1k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
140
Transcript
getting started with the spark core 1
2
hardware • 72MHz ARM Cortex M3 • TI CC3000 WiFi
• 7 analog IO (pwm out), 7 digital IO • ~ S$ 55 • coming soon: Photon, 120MHz, Broadcom Wifi, half the price 3
setup, the easy and unreliable way • install smartphone app
• power up spark • use smartphone app to create cloud account and register the core 4
setup, the better way (USB) npm install spark-cli spark setup
5
ready? • your spark core should have a name and
be breathing cyan by now 6
the tinker firmware • default firmware of spark core •
allows access to all inputs/outputs 7
let’s ask the cloud export SPARK_CORE_ID=53ff71065075535128311587 export SPARK_ACCESS_TOKEN=[get this from
https://spark.io/ build or “spark login”] 8
let’s ask the cloud curl -H "Authorization: Bearer $SPARK_ACCESS_TOKEN” https://
api.spark.io/v1/devices/$SPARK_CORE_ID/ Alternatively include the token in the URL: https://api.spark.io/v1/devices/$SPARK_CORE_ID/?access_token= $SPARK_ACCESS_TOKEN 9
output { "id": "53ff71065075535128311587", "name": "schnitzel", "connected": true, "variables": {},
"functions": [ "digitalread", "digitalwrite", "analogread", "analogwrite" ], "cc3000_patch_version": "1.29" 10
using functions curl https://api.spark.io/v1/devices/$SPARK_CORE_ID/ digitalwrite?access_token=$SPARK_ACCESS_TOKEN -d params=D7,LOW or include access_token
in POST data: curl https://api.spark.io/v1/devices/$SPARK_CORE_ID/ digitalwrite -d access_token=$SPARK_ACCESS_TOKEN -d params=D7,LOW 11
response { "id": "53ff71065075535128311587", "name": "schnitzel", "last_app": null, "connected": true,
"return_value": 1 } 12
the cloud API • events, functions, variables • http://docs.spark.io/api/ 13
the javascript API • runs in browser and in nodejs
• (npm|bower) install spark • http://docs.spark.io/javascript/ 14
voodoospark • alternative firmware • faster communication through local TCP
connection • npm client module • still uses cloud for facilitating local connection 15
DIY, noob mode 16
DIY, noob mode #2 17
DIY spark compile myapp.ino spark flash firmware_1421160254713.bin 18
DIY, hardcore mode brew tap PX4/homebrew-px4 brew update brew install
gcc-arm-none-eabi-48 brew install dfu-util git clone https://github.com/spark/core-firmware.git git clone https://github.com/spark/core-common-lib.git git clone https://github.com/spark/core-communication-lib.git 19
DIY, hardcore mode 20
DIY, hardcore mode cd core-firmware/build make 21
flash via USB • press&hold mode button, tap and release
RST button until LED flashes yellow • spark core is now in DFU mode 22
flash via USB make program-dfu 23
flash via cloud make program-cloud 24
create your own app mkdir core-firmware/applications/myapp vim core-firmware/applications/myapp/application.cpp cd core-firmware/build
make APP=myapp make APP=myapp program-dfu # or program-cloud 25
app structure #include "application.h" int example(String command); void setup(){ //
set up cloud functions & variables, IO pin modes Spark.function("example", example); pinMode(D7, OUTPUT); } void loop(){ // called continuously } int example(String command){ digitalWrite(D7, HIGH); delay(2000); digitalWrite(D7, LOW); return 1; } 26
app structure { "id": "53ff71065075535128311587", "name": "schnitzel", "connected": true, "variables":
{}, "functions": [ "example" ], "cc3000_patch_version": "1.29" 27
documentation • http://docs.spark.io/firmware/ 28
my current project 29
my current project • websockets • static site hosted on
S3 • direct connection from browser to spark • https://github.com/ponyfleisch/cloudlamp 30