SlideShare une entreprise Scribd logo
1  sur  13
Silverlight にマイコンをつないでみよう 蜜葉 優
Profile H.N. :蜜葉 優 本名:泉本 優輝 職種:関西大学総合情報学部 4 回生 Twitter : mitsuba_tan Blog :  蜜葉の日記 http://d.hatena.ne.jp/c-mitsuba/
SL4 の OOB で COM が 叩けるようになりましたね!
Windows7 からセンサの API が 使えるとか、 センサ・フィジカルが流行ってますね。
マイコンを持ってきました Japanino 大人の科学 No27 の付録
センサー API に対応してないので 強引にやってみました。
マイコンのコード 単語4つをランダムで シリアル通信で送信する コードを書いています。 void loop()  {  key = random(4); switch(key%4){ case 0: Serial.println(".net4"); break; case 1: Serial.println("Silverlight"); break; case 2: Serial.println("WPF"); break; case 3: Serial.println("Azure"); break; } key++; }
C# dynamic com; private void button2_Click(object sender, RoutedEventArgs e) {  com = AutomationFactory.CreateObject(&quot;ActiveXperts.ComPort&quot;); dynamic count = com.GetDeviceCount(); StringBuilder sb = new StringBuilder(); List<dynamic> devices = new List<dynamic>(); for (int i = 1; i <= 9; i++) { devices.Add(&quot;COM&quot; + i); } for (int i = 0; i < count; i++) { devices.Add(com.GetDevice(i)); } devicelst.ItemsSource = devices; }
Beta 版からの変更点 beta 版からの変更   ComAutomationFactory Class  名前空間: System.Windows.Interop   ↓   AutomationFactory Class  名前空間:   System.Runtime.InteropServices.Automation
マイコンから値取ってくる private void Storyboard1_Completed(object sender, EventArgs e) { com.Sleep(200); buffer = com.ReadString(); if (buffer == &quot;&quot;) { com.Close(); return; } tb.Dispatcher.BeginInvoke(delegate() { tb.Text += &quot;&quot; + com.ReadString(); }); Storyboard1.Begin(); }
DEMO
さいごに ,[object Object],[object Object],[object Object]
ご清聴ありがとうございました。

Contenu connexe

Plus de c-mitsuba

Beginning of HoloMagicians
Beginning of HoloMagiciansBeginning of HoloMagicians
Beginning of HoloMagiciansc-mitsuba
 
Build 2021 Topics & Unofficial Talks for Windows Development
Build 2021 Topics & Unofficial Talks for Windows DevelopmentBuild 2021 Topics & Unofficial Talks for Windows Development
Build 2021 Topics & Unofficial Talks for Windows Developmentc-mitsuba
 
Avalonia for MacApps
Avalonia for MacAppsAvalonia for MacApps
Avalonia for MacAppsc-mitsuba
 
nameless ある沼にDeepDiveした人のポートフォリオ
nameless ある沼にDeepDiveした人のポートフォリオnameless ある沼にDeepDiveした人のポートフォリオ
nameless ある沼にDeepDiveした人のポートフォリオc-mitsuba
 
Emotional space
Emotional spaceEmotional space
Emotional spacec-mitsuba
 
Designer’s Design Talk Azure / Windows Development 2人のMVPの場合 -
Designer’s  Design Talk Azure / Windows Development  2人のMVPの場合 -Designer’s  Design Talk Azure / Windows Development  2人のMVPの場合 -
Designer’s Design Talk Azure / Windows Development 2人のMVPの場合 -c-mitsuba
 
うるしまカップ パネルディスカッション
うるしまカップ パネルディスカッションうるしまカップ パネルディスカッション
うるしまカップ パネルディスカッションc-mitsuba
 
Designer’s Design Talk - Azure / Windows Development 2人のMVPの場合 -
Designer’s Design Talk - Azure / Windows Development 2人のMVPの場合 - Designer’s Design Talk - Azure / Windows Development 2人のMVPの場合 -
Designer’s Design Talk - Azure / Windows Development 2人のMVPの場合 - c-mitsuba
 
30min serverless-x tuber
30min serverless-x tuber30min serverless-x tuber
30min serverless-x tuberc-mitsuba
 
HoloLensで航空管制
HoloLensで航空管制HoloLensで航空管制
HoloLensで航空管制c-mitsuba
 
Introducing micro:bit and demo
Introducing micro:bit and demoIntroducing micro:bit and demo
Introducing micro:bit and democ-mitsuba
 
micro:bitさわってみた。
micro:bitさわってみた。micro:bitさわってみた。
micro:bitさわってみた。c-mitsuba
 
HoloLens Demo
HoloLens DemoHoloLens Demo
HoloLens Democ-mitsuba
 
楽しく生きるために 何を選択して、どうしてきたか。
楽しく生きるために 何を選択して、どうしてきたか。楽しく生きるために 何を選択して、どうしてきたか。
楽しく生きるために 何を選択して、どうしてきたか。c-mitsuba
 
Dotnetlab: Introducing Fluent Design System and Mixed Reality
Dotnetlab: Introducing Fluent Design System and Mixed RealityDotnetlab: Introducing Fluent Design System and Mixed Reality
Dotnetlab: Introducing Fluent Design System and Mixed Realityc-mitsuba
 
to tanzanite
to tanzanite to tanzanite
to tanzanite c-mitsuba
 
Introduction Xamarin forms mac
Introduction Xamarin forms macIntroduction Xamarin forms mac
Introduction Xamarin forms macc-mitsuba
 
Tried to touch Xamarin Forms for MacOS
Tried to touch Xamarin Forms for MacOSTried to touch Xamarin Forms for MacOS
Tried to touch Xamarin Forms for MacOSc-mitsuba
 

Plus de c-mitsuba (20)

Beginning of HoloMagicians
Beginning of HoloMagiciansBeginning of HoloMagicians
Beginning of HoloMagicians
 
Build 2021 Topics & Unofficial Talks for Windows Development
Build 2021 Topics & Unofficial Talks for Windows DevelopmentBuild 2021 Topics & Unofficial Talks for Windows Development
Build 2021 Topics & Unofficial Talks for Windows Development
 
Avalonia for MacApps
Avalonia for MacAppsAvalonia for MacApps
Avalonia for MacApps
 
Me
MeMe
Me
 
nameless ある沼にDeepDiveした人のポートフォリオ
nameless ある沼にDeepDiveした人のポートフォリオnameless ある沼にDeepDiveした人のポートフォリオ
nameless ある沼にDeepDiveした人のポートフォリオ
 
Emotional space
Emotional spaceEmotional space
Emotional space
 
Designer’s Design Talk Azure / Windows Development 2人のMVPの場合 -
Designer’s  Design Talk Azure / Windows Development  2人のMVPの場合 -Designer’s  Design Talk Azure / Windows Development  2人のMVPの場合 -
Designer’s Design Talk Azure / Windows Development 2人のMVPの場合 -
 
うるしまカップ パネルディスカッション
うるしまカップ パネルディスカッションうるしまカップ パネルディスカッション
うるしまカップ パネルディスカッション
 
Designer’s Design Talk - Azure / Windows Development 2人のMVPの場合 -
Designer’s Design Talk - Azure / Windows Development 2人のMVPの場合 - Designer’s Design Talk - Azure / Windows Development 2人のMVPの場合 -
Designer’s Design Talk - Azure / Windows Development 2人のMVPの場合 -
 
30min serverless-x tuber
30min serverless-x tuber30min serverless-x tuber
30min serverless-x tuber
 
HoloLensで航空管制
HoloLensで航空管制HoloLensで航空管制
HoloLensで航空管制
 
Introducing micro:bit and demo
Introducing micro:bit and demoIntroducing micro:bit and demo
Introducing micro:bit and demo
 
micro:bitさわってみた。
micro:bitさわってみた。micro:bitさわってみた。
micro:bitさわってみた。
 
HoloLens Demo
HoloLens DemoHoloLens Demo
HoloLens Demo
 
楽しく生きるために 何を選択して、どうしてきたか。
楽しく生きるために 何を選択して、どうしてきたか。楽しく生きるために 何を選択して、どうしてきたか。
楽しく生きるために 何を選択して、どうしてきたか。
 
Dotnetlab: Introducing Fluent Design System and Mixed Reality
Dotnetlab: Introducing Fluent Design System and Mixed RealityDotnetlab: Introducing Fluent Design System and Mixed Reality
Dotnetlab: Introducing Fluent Design System and Mixed Reality
 
WinMR入門
WinMR入門WinMR入門
WinMR入門
 
to tanzanite
to tanzanite to tanzanite
to tanzanite
 
Introduction Xamarin forms mac
Introduction Xamarin forms macIntroduction Xamarin forms mac
Introduction Xamarin forms mac
 
Tried to touch Xamarin Forms for MacOS
Tried to touch Xamarin Forms for MacOSTried to touch Xamarin Forms for MacOS
Tried to touch Xamarin Forms for MacOS
 

Dernier

LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイスCRI Japan, Inc.
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptxsn679259
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Gamesatsushi061452
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsWSO2
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video UnderstandingToru Tamaki
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルCRI Japan, Inc.
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...Toru Tamaki
 

Dernier (10)

LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 

VSUG_LT Silverlight&Arduino