4

Let’s get physical

 2 years ago
source link: https://www.compositional-it.com/news-blog/lets-get-physical/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Software isn't soft

As a kid who loved finding out how things work and exploring technology, I was drawn from a very early age towards computers and software.

I had my first programming lessons in Basic on a C64, and I was amazed at how I could invent new things, seemingly only limited by my skill and imagination.

One of the primary draws of software engineering, both then and now, has been the low barrier to entry.

All you really need to get started is a basic laptop and free tools.

You can create as many programs as you like, which are as large and complex as you want, for no extra cost.

If you make a catastrophic mistake, you can usually just reset the software and roll back your code changes with a couple of clicks.

Hardware isn't hard

As great as software development is, I have always looked with a touch of envy at my friends who work with hardware, directly building it and / or writing embedded software.

There is something about making things physically happen in the real world that I find particularly exciting.

There are a fantastic selection of devices out there which allow you to connect electronics and control them with software.

You may have heard of some of them such as Arduino and Raspberry Pi. They come in many shapes and sizes, with a range of abilities.

One of these in particular caught my eye when it launched as a Kickstarter project a couple of years ago - The Meadow F7 Micro from Wilderness Labs.

58401c452710a07066ffc62cac3cfa05_original.png

The reason I found this particular platform really exciting is that it allows you to write software for the board using full, modern F# and C#, with the tools and IDEs you are familiar with.

The other big draw for me was the ecosystem around the platform, including the Meadow.Core and Meadow.Foundation libraries.

These provide ready-made classes that you can use to interact with a massive number of popular electronics components quickly and easily.

Additionally, they provide a collection of frameworks for tasks such as drawing graphics and text, or running a web server.

This all comes together to make experimenting a breeze, about as close to a 'plug and play' experience that you could hope for.

You can explore new things whilst building upon the knowledge and experience you already have as a .NET developer.

The amazing thing is that they accomplish all of this on a device with a 216Mhz CPU and 32MB RAM!

You get the compute, power and form factor characteristics of an Arduino, with the tools and language support of a Raspberry Pi.

There is no Linux or Windows here - the board uses a 'real time OS', which is just enough to run your code with a specially tailored version of Mono.

This means the device can even be powered by a small solar cell or battery, greatly expanding its possible applications. Strap it to a rover! Monitor your plants! The possibilities are endless.

Example projects

Wilderness Labs have a bunch of sample projects on their website, which are a great way to get started.

These are all presented in C#, however F# is fully supported and is presented as an option when creating a new project.

I'm working through these samples and porting them over to F# as I go, which has been very simple.

I started with the 'EdgeASketch' as this looked fun.

EdgeASketch-1.gif

I have pushed the F# version to a repo on Github, and I will continue to do the same with the others as I get to them.

Where can I get one?

We ordered a Hack Kit Pro for each of the team recently, which is a great option for people just getting into this kind of thing. It comes with a huge selection of wires, components, sensors, screens etc to get you started, plus a Meadow F7, a couple of breadboards and a nicely etched mounting board.

IMG_1112_2_1024x1024@2x-1.jpg

You can also buy the dev kit which doesn't come with all the extra components if you already have your own.

At the time of writing they have sold out of all the kits (I guess we got the last ones!) but I am sure they will be back in stock soon.

The platform is still officially in beta and they have published a roadmap to version 1.0 which is planned to ship later this year.

Going deeper

Once you have experimented with the sample projects, perhaps tweaked them a bit, you are probably going to want to start designing and building your own circuits.

The Meadow Foundation libraries help a lot with this, as they abstract away the hardware specifics and allow you to concentrate on behaviour for the most part.

As you design more complex things however, you will probably find that revising some high-school physics will pay dividends!

For example, one thing you will need to take into consideration is power draw. There is naturally only so much that the board can provide directly before requiring an external power source, so being able to calculate and test this is important.

Luckily it is 2021 and we have an internet full of resources for such things 🎉.

Wilderness Labs themselves have a great beginner electronics tutorial on their website.

When I found the diode physics section a little challenging, I came across a really good Youtube channel called The Engineering Mindset. They have a playlist of videos which cover all the basics and complement the Wilderness Labs series nicely.

Conclusion

I am (quite obviously) really excited about the new world of opportunities that the Meadow platform has opened up for me as, ostensibly, a '.NET enterprise software developer'.

Coming from a mobile app background, the development cycle feels very comfortable and familiar. This probably isn't a coincedence, as the people behind Wilderness Labs used to be part of the team at Xamarin.

I found the setup and installation to be quick and painless, and I'm having a ton of fun and learning things along the way.

I've also met some lovely folks in their Slack channel who have been very helpful.

I hope that the F# samples I am sharing will be useful to the community, and if you would like to contribute anything then of course we welcome any PRs.

It's awesome that .NET, and by proxy F#, really does run everywhere today - even tiny IOT devices!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK