SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Terminal share of
FlashAir W-04
W-04で
端子共有してみた
By さや(Saya)
FlashAir Developers Summit 2018 2018/2/24(sat)
Abut me
Pen name:Saya
Twitter :@La_zlo
I will scatter seeds by following my heart.
The content of this presentation is based on
hobby's challenge and simple test, and there
is no guarantee. Also, it is not an
presentation representing my organization.
Lightning Talk
W-04 has 5 general-
purpose terminals
-What shall we connect?
-What combination can be used
simultaneously?
-How can I control it?
I checked the behavior
of the terminals
Relations of terminal and the Lua functions
Reference)
·Simple SD specification (https://www.sdcard.org/downloads/pls/index.html)
·Lua function reference (https://www.flashair-developers.com/en/documents/api/lua/)
·Doujinshi of FlashAir (https://www.flashair-developers.com/en/documents/books/)
·Behavior analysis of W-04
· fa.spi() and fa.i2c(), set to a specific IO state when "init“ is executed.
· Switching from fa.pio() to fa.spi(), "init“ is NOT requires.
· Switching from fa.pio() to fa.i2c(), "init" is required.
FlashAir W-04 (V4.00.01)
fa.pio
GPIO SPI "init" I2C "init" Terminal handling
5 CLK I RSV RSV - RSV - Pull-down is preferable
2 CMD I 0x01 DO O(L) SCL I
7 DAT0 I 0x02 CLK O(*1) SDA I
8 DAT1 I 0x04 CS O(H) RSV I
9 DAT2 I 0x08 DI *2 I RSV O(H)
1 CD/DAT3 I (pull-up) 0x10 RSV *3 O(L) RSV I Avoid pull-down
4 2.7-3.6V
6 GND
3 GND
*1: "O (L)" when "mode" is 0 or 3, "O (H)" when "mode" is 1 or 2 H: High
*2: If I / O is "O", "L" is output by "write" or "read". L: Low
*3: If I / O is "O", "H" is output by "write" or "read".
after
power on
fa.spi fa.i2c
VCC
VSS2
VSS1
Pin
No.
SD standard FlashAir original function
Remarks
SD
interfase
Is it possible to transition
without changing the state of IO?
Power on
I2C mode
SPI modePIO mode
fa.spi(“init”,xx)fa.pio(xx,yy)
fa.pio(xx,yy)
fa.spi(“init”,xx)
fa.spi(“write”,xx)
fa.spi(“read”,xx)
fa.pio(xx,yy) fa.spi(“init”,xx)
fa.i2c{mode=“init”, …)
Card mode
Card access
SD I/F wait
Example of case size gadget
Soramame-18 connections
Shining, Sounding, Sensing
+3.3V
Wiring plan of Soramame-18
4 general-purpose terminals to use
SD standard Gadget
fa.pio assumption LED strip tact sw
Piezo
Sounder
register
GPIO SPI "init" IO setting APA102C TS-001 20mmφ 1Morm
5 CLK RSV RSV - - - - - -
2 CMD 0x01 DO O(L) O(L) DI - ◎ ○
7 DAT0 0x02 CLK O(*1) O(L) or I CI - - -
8 DAT1 0x04 CS O(H) O(H) - - - -
9 DAT2 0x08 DI *2 I I - - ○ ○
1 CD/DAT3 0x10 RSV *3 O(L) O(L) or I - ○ - -
4 - VCC 10kΩ - -
3 - GND ○ - -
6 - - - - -
VSS1
VSS2
Pin
No.
FlashAir original function Parts
SD
interfase
fa.spi
VCC
Lua script
■Light LED strip
■Sound buzzer
■Read the state of a switch
■Try a touch sensor
APA102C
Light LED strip
Full color LED lit with SPI function
No sound if it is
set as input
SPI
control
s={}
s[1] = 0x00000000
for i=1, 5 do
s[i+1] =
<brightness+BGR>
end
s[7] = 0xFFFFFFFF
fa.spi("mode",0)
fa.spi("bit",32)
fa.spi("init",1)
fa.pio(0x07,0x04)
fa.spi("write",s)
Sound buzzer
Vibrate piezoelectric sounder
with SPI function
output
“L”
s=string.rep(
"xAA", <sound length>)
fa.spi("mode",0)
fa.spi("bit",8)
fa.spi("init",<interval>)
fa.pio(0x0F,0x04)
fa.spi("write",s)
LED will not respond
unless you send
0x00000000
Read the state of a switch
Confirm switch status
with PIO function
s, t = fa.pio(0x07,0x04)
k = bit32.btest(t,0x10)
0: SW ON
1: SW OFF
Try a touch sensor
SMeasure response time with SPI
function ⇒Failed
fa.spi("mode",0)
fa.spi("bit",32)
fa.spi("init",1)
fa.pio(0x07,0x04)
t = fa.spi(
"write", 0x80000000)
n=0
while(t>0) do
n=n+1; t=bit32.lshift(t,1)
end
print(n)
[Reference] Arduino touch senser by KOUSAKU
(http://kousaku-kousaku.blogspot.jp/2008/10/arduino.html)
set as
input
LED will not respond
unless you send
0x00000000
Video Demo
Link to Twitter
https://twitter.com/search?f=videos
&q=from%3ALa_zlo%20%23FlashAir
Conclusion
■Switching from fa.pio() to
fa.spi() requires NO "init“
■ Terminal sharing with W-04
・Light LED strip
・Sound buzzer
・ Read the state of a switch
■Re-examination required
・ Try a touch sensor
Thank you for
your attention
Pen name:Saya
Twitter :@La_zlo

Weitere ähnliche Inhalte

Ähnlich wie Terminal sharing and GPIO experiments with the FlashAir W-04

The true story_of_hello_world
The true story_of_hello_worldThe true story_of_hello_world
The true story_of_hello_worldfantasy zheng
 
07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W matters07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W mattersAlexandre Moneger
 
FPGA処理をROSコンポーネント化する自動設計環境
FPGA処理をROSコンポーネント化する自動設計環境FPGA処理をROSコンポーネント化する自動設計環境
FPGA処理をROSコンポーネント化する自動設計環境Kazushi Yamashina
 
Introduction to FPGA, VHDL
Introduction to FPGA, VHDL  Introduction to FPGA, VHDL
Introduction to FPGA, VHDL Amr Rashed
 
Stm32 f4 first touch
Stm32 f4 first touchStm32 f4 first touch
Stm32 f4 first touchBenux Wei
 
Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...inside-BigData.com
 
Microprocessor Unit 2.PDF
Microprocessor Unit 2.PDFMicroprocessor Unit 2.PDF
Microprocessor Unit 2.PDFPrachi Gawande
 
A microprocessor is the main component of a microcomputer system and is also ...
A microprocessor is the main component of a microcomputer system and is also ...A microprocessor is the main component of a microcomputer system and is also ...
A microprocessor is the main component of a microcomputer system and is also ...jeronimored
 
VHDL Practical Exam Guide
VHDL Practical Exam GuideVHDL Practical Exam Guide
VHDL Practical Exam GuideEslam Mohammed
 
Vhdl practical exam guide
Vhdl practical exam guideVhdl practical exam guide
Vhdl practical exam guideEslam Mohammed
 
Finding Xori: Malware Analysis Triage with Automated Disassembly
Finding Xori: Malware Analysis Triage with Automated DisassemblyFinding Xori: Malware Analysis Triage with Automated Disassembly
Finding Xori: Malware Analysis Triage with Automated DisassemblyPriyanka Aash
 
HKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting ReviewHKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting ReviewLinaro
 
Rust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command LineRust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command LineMatt Provost
 
Virtual platform
Virtual platformVirtual platform
Virtual platformsean chen
 
DPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet ProcessingDPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet ProcessingMichelle Holley
 

Ähnlich wie Terminal sharing and GPIO experiments with the FlashAir W-04 (20)

SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
The true story_of_hello_world
The true story_of_hello_worldThe true story_of_hello_world
The true story_of_hello_world
 
07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W matters07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W matters
 
Joel Falcou, Boost.SIMD
Joel Falcou, Boost.SIMDJoel Falcou, Boost.SIMD
Joel Falcou, Boost.SIMD
 
FPGA処理をROSコンポーネント化する自動設計環境
FPGA処理をROSコンポーネント化する自動設計環境FPGA処理をROSコンポーネント化する自動設計環境
FPGA処理をROSコンポーネント化する自動設計環境
 
Introduction to FPGA, VHDL
Introduction to FPGA, VHDL  Introduction to FPGA, VHDL
Introduction to FPGA, VHDL
 
Stm32 f4 first touch
Stm32 f4 first touchStm32 f4 first touch
Stm32 f4 first touch
 
Important questions
Important questionsImportant questions
Important questions
 
Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...
 
Microprocessor Unit 2.PDF
Microprocessor Unit 2.PDFMicroprocessor Unit 2.PDF
Microprocessor Unit 2.PDF
 
A microprocessor is the main component of a microcomputer system and is also ...
A microprocessor is the main component of a microcomputer system and is also ...A microprocessor is the main component of a microcomputer system and is also ...
A microprocessor is the main component of a microcomputer system and is also ...
 
Spi drivers
Spi driversSpi drivers
Spi drivers
 
CompilersAndLibraries
CompilersAndLibrariesCompilersAndLibraries
CompilersAndLibraries
 
VHDL Practical Exam Guide
VHDL Practical Exam GuideVHDL Practical Exam Guide
VHDL Practical Exam Guide
 
Vhdl practical exam guide
Vhdl practical exam guideVhdl practical exam guide
Vhdl practical exam guide
 
Finding Xori: Malware Analysis Triage with Automated Disassembly
Finding Xori: Malware Analysis Triage with Automated DisassemblyFinding Xori: Malware Analysis Triage with Automated Disassembly
Finding Xori: Malware Analysis Triage with Automated Disassembly
 
HKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting ReviewHKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting Review
 
Rust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command LineRust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command Line
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
 
DPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet ProcessingDPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet Processing
 

Mehr von FlashAirデベロッパーズ

FlashAir IoT Hubで計測値・イメージをアップロード!
FlashAir IoT Hubで計測値・イメージをアップロード!FlashAir IoT Hubで計測値・イメージをアップロード!
FlashAir IoT Hubで計測値・イメージをアップロード!FlashAirデベロッパーズ
 
TOSHIBAxGUGEN FlashAirハッカソン-FlashAirでなに作る?
TOSHIBAxGUGEN FlashAirハッカソン-FlashAirでなに作る?TOSHIBAxGUGEN FlashAirハッカソン-FlashAirでなに作る?
TOSHIBAxGUGEN FlashAirハッカソン-FlashAirでなに作る?FlashAirデベロッパーズ
 
[Maker Faire Tokyo 2014] FlashAirは超ミニマイコン! ひろがる電子工作コミュニティ
[Maker Faire Tokyo 2014] FlashAirは超ミニマイコン!ひろがる電子工作コミュニティ[Maker Faire Tokyo 2014] FlashAirは超ミニマイコン!ひろがる電子工作コミュニティ
[Maker Faire Tokyo 2014] FlashAirは超ミニマイコン! ひろがる電子工作コミュニティFlashAirデベロッパーズ
 
SDカードで無線Lチカ? FlashAirは超ミニマイコン!★Arduino用シールド(基板)配布中
SDカードで無線Lチカ?FlashAirは超ミニマイコン!★Arduino用シールド(基板)配布中SDカードで無線Lチカ?FlashAirは超ミニマイコン!★Arduino用シールド(基板)配布中
SDカードで無線Lチカ? FlashAirは超ミニマイコン!★Arduino用シールド(基板)配布中FlashAirデベロッパーズ
 
SDカードで無線LチカFlashAirは超ミニマイコンアイデアコンテストも実施中
SDカードで無線LチカFlashAirは超ミニマイコンアイデアコンテストも実施中SDカードで無線LチカFlashAirは超ミニマイコンアイデアコンテストも実施中
SDカードで無線LチカFlashAirは超ミニマイコンアイデアコンテストも実施中FlashAirデベロッパーズ
 
FlashAirの組み込み機器応用事例@OSC2014 Tokyo/Spring
FlashAirの組み込み機器応用事例@OSC2014 Tokyo/SpringFlashAirの組み込み機器応用事例@OSC2014 Tokyo/Spring
FlashAirの組み込み機器応用事例@OSC2014 Tokyo/SpringFlashAirデベロッパーズ
 

Mehr von FlashAirデベロッパーズ (7)

[FlashAir Developers Summit] FlashAirの紹介
[FlashAir Developers Summit] FlashAirの紹介[FlashAir Developers Summit] FlashAirの紹介
[FlashAir Developers Summit] FlashAirの紹介
 
FlashAir IoT Hubで計測値・イメージをアップロード!
FlashAir IoT Hubで計測値・イメージをアップロード!FlashAir IoT Hubで計測値・イメージをアップロード!
FlashAir IoT Hubで計測値・イメージをアップロード!
 
TOSHIBAxGUGEN FlashAirハッカソン-FlashAirでなに作る?
TOSHIBAxGUGEN FlashAirハッカソン-FlashAirでなに作る?TOSHIBAxGUGEN FlashAirハッカソン-FlashAirでなに作る?
TOSHIBAxGUGEN FlashAirハッカソン-FlashAirでなに作る?
 
[Maker Faire Tokyo 2014] FlashAirは超ミニマイコン! ひろがる電子工作コミュニティ
[Maker Faire Tokyo 2014] FlashAirは超ミニマイコン!ひろがる電子工作コミュニティ[Maker Faire Tokyo 2014] FlashAirは超ミニマイコン!ひろがる電子工作コミュニティ
[Maker Faire Tokyo 2014] FlashAirは超ミニマイコン! ひろがる電子工作コミュニティ
 
SDカードで無線Lチカ? FlashAirは超ミニマイコン!★Arduino用シールド(基板)配布中
SDカードで無線Lチカ?FlashAirは超ミニマイコン!★Arduino用シールド(基板)配布中SDカードで無線Lチカ?FlashAirは超ミニマイコン!★Arduino用シールド(基板)配布中
SDカードで無線Lチカ? FlashAirは超ミニマイコン!★Arduino用シールド(基板)配布中
 
SDカードで無線LチカFlashAirは超ミニマイコンアイデアコンテストも実施中
SDカードで無線LチカFlashAirは超ミニマイコンアイデアコンテストも実施中SDカードで無線LチカFlashAirは超ミニマイコンアイデアコンテストも実施中
SDカードで無線LチカFlashAirは超ミニマイコンアイデアコンテストも実施中
 
FlashAirの組み込み機器応用事例@OSC2014 Tokyo/Spring
FlashAirの組み込み機器応用事例@OSC2014 Tokyo/SpringFlashAirの組み込み機器応用事例@OSC2014 Tokyo/Spring
FlashAirの組み込み機器応用事例@OSC2014 Tokyo/Spring
 

Kürzlich hochgeladen

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Kürzlich hochgeladen (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

Terminal sharing and GPIO experiments with the FlashAir W-04

  • 1. Terminal share of FlashAir W-04 W-04で 端子共有してみた By さや(Saya) FlashAir Developers Summit 2018 2018/2/24(sat)
  • 2. Abut me Pen name:Saya Twitter :@La_zlo I will scatter seeds by following my heart. The content of this presentation is based on hobby's challenge and simple test, and there is no guarantee. Also, it is not an presentation representing my organization. Lightning Talk
  • 3. W-04 has 5 general- purpose terminals -What shall we connect? -What combination can be used simultaneously? -How can I control it? I checked the behavior of the terminals
  • 4. Relations of terminal and the Lua functions Reference) ·Simple SD specification (https://www.sdcard.org/downloads/pls/index.html) ·Lua function reference (https://www.flashair-developers.com/en/documents/api/lua/) ·Doujinshi of FlashAir (https://www.flashair-developers.com/en/documents/books/) ·Behavior analysis of W-04 · fa.spi() and fa.i2c(), set to a specific IO state when "init“ is executed. · Switching from fa.pio() to fa.spi(), "init“ is NOT requires. · Switching from fa.pio() to fa.i2c(), "init" is required. FlashAir W-04 (V4.00.01) fa.pio GPIO SPI "init" I2C "init" Terminal handling 5 CLK I RSV RSV - RSV - Pull-down is preferable 2 CMD I 0x01 DO O(L) SCL I 7 DAT0 I 0x02 CLK O(*1) SDA I 8 DAT1 I 0x04 CS O(H) RSV I 9 DAT2 I 0x08 DI *2 I RSV O(H) 1 CD/DAT3 I (pull-up) 0x10 RSV *3 O(L) RSV I Avoid pull-down 4 2.7-3.6V 6 GND 3 GND *1: "O (L)" when "mode" is 0 or 3, "O (H)" when "mode" is 1 or 2 H: High *2: If I / O is "O", "L" is output by "write" or "read". L: Low *3: If I / O is "O", "H" is output by "write" or "read". after power on fa.spi fa.i2c VCC VSS2 VSS1 Pin No. SD standard FlashAir original function Remarks SD interfase
  • 5. Is it possible to transition without changing the state of IO? Power on I2C mode SPI modePIO mode fa.spi(“init”,xx)fa.pio(xx,yy) fa.pio(xx,yy) fa.spi(“init”,xx) fa.spi(“write”,xx) fa.spi(“read”,xx) fa.pio(xx,yy) fa.spi(“init”,xx) fa.i2c{mode=“init”, …) Card mode Card access SD I/F wait
  • 6. Example of case size gadget Soramame-18 connections Shining, Sounding, Sensing +3.3V
  • 7. Wiring plan of Soramame-18 4 general-purpose terminals to use SD standard Gadget fa.pio assumption LED strip tact sw Piezo Sounder register GPIO SPI "init" IO setting APA102C TS-001 20mmφ 1Morm 5 CLK RSV RSV - - - - - - 2 CMD 0x01 DO O(L) O(L) DI - ◎ ○ 7 DAT0 0x02 CLK O(*1) O(L) or I CI - - - 8 DAT1 0x04 CS O(H) O(H) - - - - 9 DAT2 0x08 DI *2 I I - - ○ ○ 1 CD/DAT3 0x10 RSV *3 O(L) O(L) or I - ○ - - 4 - VCC 10kΩ - - 3 - GND ○ - - 6 - - - - - VSS1 VSS2 Pin No. FlashAir original function Parts SD interfase fa.spi VCC
  • 8. Lua script ■Light LED strip ■Sound buzzer ■Read the state of a switch ■Try a touch sensor
  • 9. APA102C Light LED strip Full color LED lit with SPI function No sound if it is set as input SPI control s={} s[1] = 0x00000000 for i=1, 5 do s[i+1] = <brightness+BGR> end s[7] = 0xFFFFFFFF fa.spi("mode",0) fa.spi("bit",32) fa.spi("init",1) fa.pio(0x07,0x04) fa.spi("write",s)
  • 10. Sound buzzer Vibrate piezoelectric sounder with SPI function output “L” s=string.rep( "xAA", <sound length>) fa.spi("mode",0) fa.spi("bit",8) fa.spi("init",<interval>) fa.pio(0x0F,0x04) fa.spi("write",s) LED will not respond unless you send 0x00000000
  • 11. Read the state of a switch Confirm switch status with PIO function s, t = fa.pio(0x07,0x04) k = bit32.btest(t,0x10) 0: SW ON 1: SW OFF
  • 12. Try a touch sensor SMeasure response time with SPI function ⇒Failed fa.spi("mode",0) fa.spi("bit",32) fa.spi("init",1) fa.pio(0x07,0x04) t = fa.spi( "write", 0x80000000) n=0 while(t>0) do n=n+1; t=bit32.lshift(t,1) end print(n) [Reference] Arduino touch senser by KOUSAKU (http://kousaku-kousaku.blogspot.jp/2008/10/arduino.html) set as input LED will not respond unless you send 0x00000000
  • 13. Video Demo Link to Twitter https://twitter.com/search?f=videos &q=from%3ALa_zlo%20%23FlashAir
  • 14. Conclusion ■Switching from fa.pio() to fa.spi() requires NO "init“ ■ Terminal sharing with W-04 ・Light LED strip ・Sound buzzer ・ Read the state of a switch ■Re-examination required ・ Try a touch sensor
  • 15. Thank you for your attention Pen name:Saya Twitter :@La_zlo