In this session delivered for the Microsoft Reactor in London, I talk about how you can control a 3D printed Robot Arm with a Raspberry Pi, .NET 8, Blazor and SignalR.
I also show how you can use a Unity app on an Oculus Quest 2 to control the arm VR too.
You can find the GitHub repo and workshop instructions here;
https://bit.ly/dotnetrobotgithub
1 of 37
Download to read offline
More Related Content
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
1. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Building a Raspberry Pi
Robot Arm with .NET 8,
Blazor and SignalR
PETE GALLAGHER
PETECODES.CO.UK
2. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
About Me
Pete Gallagher
@pete_codes
www.PeteCodes.co.uk
pete@pjgcreations.co.uk
Full Stack Dev Manager at Avanade UK
Microsoft Certified Trainer & Azure MVP, Pluralsight Author
Decades of Desktop, Web & Embedded Software experience,
Meetup Organiser,
STEM Ambassador, Code Club Organiser ´ Gadget Addict
Father of two inquisitive girls
3. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Hello World (In the
world of IoT)
Device Bindings and
Driving Servos
Raspberry Pi GPIO and
the Circuit
.NET 8 and Installing on
the Pi
Final Demos
Blazor and SignalR
What we¨re going to be doing´
4. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
.NET 8
5. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
.NET 8
INFRASTRUCTURE
.NET STANDARD
.NET everywhere
WEB CLOUD
IoT AI
DESKTOP MOBILE GAMING
6. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
What¨s new in .NET 8?
https://bit.ly/pjgdotnet8new
ARM64 Performance
Improvements
Garbage Collector
Enhancements
JSON
Enhancements
.NET
Aspire
Publish to a
Container
Maui / ASP.NET / EF
Improvements
7. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
.NET Ecosystem Momentum
> 6.1M
Monthly Active Users
In Visual Studio
#1 Most Admired
Framework
.NET Core
Top 5
Highest velocity OSS Projects
github.com/dotnet
github.com/aspnet
Top 5
Language on GitHub
C#
15x
Faster than Node.js
ASP.NET Core
40%
New to .NET are students*
dot.net download survey
.NET Conf 2023 Keynote - https://bit.ly/pjgdotnetconf2023
8. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Raspberry Pi Install
9. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Raspberry Pi Install
Single Line Install
wget -O - https://raw.githubusercontent.com/pjgpetecodes/dotnet8pi/main/install.sh | sudo bash
http://bit.ly/dotnet8pi
10. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
.NET 8 & GPIO
11. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
System.Device.Gpio
https://www.nuget.org/packages/System.Device.Gpio
Very Limited Support for
Raspberry Pi 5
Supports Linux and
Windows 10 IoT
Supports Raspberry Pi,
Beagleboard,
Hummingboard,
Odroid etc
Supports I/O, SPI,
PWM, I2C
12. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Raspberry Pi GPIO
Board Numbering
BCM Numbering
13. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Raspberry Pi Circuit 1
Pin 10
Pin 26
14. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Raspberry Pi Demo 1
Hello World (In the world of IoT)
15. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
https://www.nuget.org/packages/Iot.Device.Bindings
Explorer Hat
Sense Hat
MCP23xxx I/O Expander
BME280 Temperature /
Humidity Sensor
Much More!
Servos
Iot.Device.Bindings
16. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Raspberry Pi Circuit 2
17. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Servo Control Board
Pin 25
Pin 35
Pin 13
Pin 12
18. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Servos Control
Power
Ground
19. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Servos
20. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Raspberry Pi Demo 2
Servo Demo
21. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Blazor
22. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
^Blazor is a single-page app
framework for building
interactive client-side Web
apps with .NET ̄
Scott Hanselman
Blazor
23. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
https://bit.ly/pjgblazor
No Javascript!*
Server Side or Client
Side WebAssembley
Web UI Framework
based in C# / Razor and
HTML
Steve Sanderson¨s Pet
Project
Support in All Major
Browsers
Client Side .NET with no
plugins
Blazor
24. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
SignalR
25. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
^ASP.NET SignalR is a library for
ASP.NET developers to add real-
time web functionality to their
applications ̄
Wikipedia
SignalR
26. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
https://bit.ly/pjgsignalr
Open Source
Supports Web Sockets,
Server-Sent Events,
Long Polling
Enables Bi-directional
Real-Time communications
Created by David Fowler
and Damian Edwards
in 2011
SignalR
27. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Raspberry Pi Demo 3
Drive the Arm!
28. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Unity and VR
29. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
^Unity is a Cross-Platform Game
Engine´
Unity gives users the ability to
create games and experiences in
both 2D and 3D ̄
Wikipedia
Unity and VR
30. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
https://unity.com/
Scripting using
.NET Standard 2.0
or C# 8
Support for Virtual and
Mixed Reality
Cross Platform
Founded in 2002 by
Nicholas Francis,
Joachim Ante & David
Helgason
Adding NuGet
Packages can be painful
Build and Deploy
Directly to the Headset
Unity and VR
31. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Raspberry Pi Demo 4
VR Robots!
32. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Bonus Section!
33. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
.NET everywhere
34. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
.NET everywhere
35. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Links
? GitHub and Workshop
https://bit.ly/dotnetrobotgithub
? Installing Dot Net 8 on the Raspberry Pi
http://bit.ly/dotnet8pi
? Dot Net GPIO Nuget Package
https://www.nuget.org/packages/System.Device.Gpio
? Dot Net IoT Device Bindings Source Code
https://github.com/dotnet/iot/tree/master/src/devices
? 3D Printed Robot Arm C From the presentation
https://www.thingiverse.com/thing:1015238
? 3D Printed Robot Arm - Workshop
http://bit.ly/pjgrobotarmparts
36. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
? Twitter
@pete_codes
? Email:
pete@pjgcreations.co.uk
? Personal Website:
https://www.petecodes.co.uk
Notts IoT:
https://www.nottsiot.co.uk
? Dot Net Notts:
https://www.dotnetnotts.co
? Notts Dev Workshop:
https://www.nottsdevworkshop.co.uk
? LATi:
https://www.lati.org.uk
? Agile Engineering Podcast:
https://agileengineeringpodcast.com/
? Azureish Live:
https://www.twitch.tv/azureishlive
Contact Me
際際滷s: https://bit.ly/pjgndcsydney2024
37. Building a Robot Arm with Raspberry Pi, .NET 8, Blazor & SignalR C Copyright Pete Gallagher 2024 C @Pete_Codes
Contact Me
Pete Gallagher
@pete_codes
www.PeteCodes.co.uk
Pete@PJGCreations.co.uk
際際滷s: https://bit.ly/pjgndcsydney2024
Editor's Notes
#4: .NET Aspire C Oppinionated Cloud Ready Stack for distrusted computing
#6: .NET is an entire software development platform that takes care of a lot of the heavy lifting for you when you want to build an application. Applications frameworks help you build the specific types of apps or workloads and enable you to literally build any app for any platform with any operating system. Each .NET workload shares a common infrastructure and .NET Standard library. This means not only are your .NET skills portable, but your actual code is portable no matter what you¨re building. This makes it easy to share reusable components (called libraries) across the breadth of applications people build.
Additionally, there are a broad set of development tools that makes it really productive to write, debug, build and manage code bases.
See: www.dot.net
#7: .NET Aspire C Oppinionated Cloud Ready Stack for distrusted computing
#8: 2024:
.NET Conf 2023 Keynote - https://bit.ly/pjgdotnetconf2023
https://www.techempower.com/benchmarks/#section=data-r22&hw=ph&test=plaintext&f=zik0zj-zik0zj-zik0zj-zik0zj-zik0zj-zik0zj-hra0hr-zik0zj-zik0zj-zik0zj-qmx0qn-zik0zj-zik0zj-zik0zj-1ekf&l=8vn08w-0&c=3
2020:
Build 2020 C Journey to one .NET - https://www.youtube.com/watch?v=ctSqiD8BGPM
https://insights.stackoverflow.com/survey/2019#technology-most-loved-dreaded-and-wanted-loved3
github.com/cncf/velocity
octoverse.github.com
www.techempower.com/benchmarks/#section=data-r18&hw=ph&test=plaintext
#16: .NET Aspire C Oppinionated Cloud Ready Stack for distrusted computing
#21: Each PWM Channel is created passing in;
The Chip Number
The PWM Channel
The Frquency
Optionally, the Duty Cycle Percentage
We also then create two?ServoMotor?objects, passing in;
The PWM Channel we'll be using
The Maximum Angle of the Servo - We're using a 180 degree Servo, so we pass in 180 here
The Minimum Pulse Width
The Maximum Pulse Width
#23: Blazor replaces javascript and runs C# on the client side directly in the browsers with no plugins needed.
Blazor Server C Works as a web Server (Shipped)
Blazor Web Assembly (May 2020)
Blazor Renders HTML, but Blazor Native but can render to other things like Native Controls for Mobile.
#24: Blazor replaces javascript and runs C# on the client side directly in the browsers with no plugins needed.
Blazor Server C Works as a web Server (Shipped)
Blazor Web Assembly (May 2020)
Blazor Renders HTML, but Blazor Native but can render to other things like Native Controls for Mobile.
Originally developed as a pet project by?Steve Sanderson?at Microsoft, Blazor is Web UI Framework which is based on C#, Razor and HTML. Blazor compiles down to WebAssembly, which makes it super (or blazingly) fast (Hence the Razor with a ^B ̄).
Blazor allows developers to write client side .net´ You may say ^Oh, like Silverlight? ̄´ Nope, no plugins needed´ It¨s just supported natively in most modern browsers.
#35: Blazor replaces javascript and runs C# on the client side directly in the browsers with no plugins needed.
Blazor Server C Works as a web Server (Shipped)
Blazor Web Assembly (May 2020)
Blazor Renders HTML, but Blazor Native but can render to other things like Native Controls for Mobile.
Originally developed as a pet project by?Steve Sanderson?at Microsoft, Blazor is Web UI Framework which is based on C#, Razor and HTML. Blazor compiles down to WebAssembly, which makes it super (or blazingly) fast (Hence the Razor with a ^B ̄).
Blazor allows developers to write client side .net´ You may say ^Oh, like Silverlight? ̄´ Nope, no plugins needed´ It¨s just supported natively in most modern browsers.
#38: .NET is an entire software development platform that takes care of a lot of the heavy lifting for you when you want to build an application. Applications frameworks help you build the specific types of apps or workloads and enable you to literally build any app for any platform with any operating system. Each .NET workload shares a common infrastructure and .NET Standard library. This means not only are your .NET skills portable, but your actual code is portable no matter what you¨re building. This makes it easy to share reusable components (called libraries) across the breadth of applications people build.
Additionally, there are a broad set of development tools that makes it really productive to write, debug, build and manage code bases.
See: www.dot.net
#39: .NET is an entire software development platform that takes care of a lot of the heavy lifting for you when you want to build an application. Applications frameworks help you build the specific types of apps or workloads and enable you to literally build any app for any platform with any operating system. Each .NET workload shares a common infrastructure and .NET Standard library. This means not only are your .NET skills portable, but your actual code is portable no matter what you¨re building. This makes it easy to share reusable components (called libraries) across the breadth of applications people build.
Additionally, there are a broad set of development tools that makes it really productive to write, debug, build and manage code bases.
See: www.dot.net