Reader small image

You're reading from  Creative DIY Microcontroller Projects with TinyGo and WebAssembly

Product typeBook
Published inMay 2021
PublisherPackt
ISBN-139781800560208
Edition1st Edition
Tools
Right arrow
Author (1)
Tobias Theel
Tobias Theel
author image
Tobias Theel

Tobias Theel works as the Technical Lead and DevOps for a German FinTech startup fino and since 2020 he has also started working for RegTech startup, ClariLab, as Lead Software Engineer. Being a software architect and an expert for Go and TinyGo alongside C# and Java, he is also iSAQB certified. Theel is a highly enthusiastic community contributor and is among the top 10% responders in C# and Unity3D as well as top 20% responders in .NET, Go, and Visual Studio on StackOverflow. When not programming for fino or ClariLab, he can be found developing games, mainly at game jams such as the Ludum Dare Jam, where he develops games from scratch within 72 hours. As an active speaker at tech talks and a participant for numerous hackathons, Theel loves to share his knowledge of software development with fellow enthusiasts.
Read more about Tobias Theel

Right arrow

Chapter 1

  1. The tinygo info command.
  2. The tinygo flash command.
  3. The Arduino UNO has a clock speed of 16 MHz. Blinking at 16 MHz is extremely fast and we wouldn't be able to see it. That is why we set the LED to go on and off for a number of milliseconds.
  4. You can find the solution in the code repository: https://github.com/PacktPublishing/Creative-DIY-Microcontroller-Projects-with-TinyGo-and-WebAssembly/blob/master/Chapter01/blink-sos

Chapter 2

  1. We do this in order to prevent the LED from being damaged. Most LEDs in Arduino Starter Kits or similar kits work with voltages below 5V. Driving them with 5V could permanently damage them.
  2. Either by using an external pull-up (or pull-down) resistor or by using a built-in resistor.
  3. It needs to sleep in order to give the scheduler time to run the goroutine.
  4. You can find a solution for this question in the GitHub repository in the Chapter02 folder under traffic-lights-blink.

Chapter 3

  1. The key 3 is in row 0 column 2, so the coordinates are 0,2.
  2. You can find the solution at the following link: https://github.com/PacktPublishing/Creative-DIY-Microcontroller-Projects-with-TinyGo-and-WebAssembly/blob/master/Chapter03/safety-lock-keypad-check-key/main.go

Chapter 4

  1. Turning these sensors off saves energy and extends the lifetime of the water level sensors as it slows down corrosion.
  2. The circuit is closed when the signal is high in the Signal (In) port.

Chapter 5

  1. The 5V pin is deactivated by default. It requires soldering to activate it. Alternatively, the VIN pin could be used when the Arduino is powered through the USB port.
  2. pulseLength holds the time from sending out the pulse until returning it. So the pulse traveled the distance twice. That is why we have to divide pulseLength by 2.
  3. Find the solution here: https://github.com/PacktPublishing/Creative-DIY-Microcontroller-Projects-with-TinyGo-and-WebAssembly/blob/master/Chapter05/touchless-handwash-timer-120seconds/main.go

Chapter 6

  1. An I2C message contains the address of the device the message is dedicated to.
  2. The CS pin is being used to signal that a message is dedicated to a specific device as the CS pin is directly connected to the device.

Chapter 7

  1. To ensure that a message gets delivered, we need to use QOS level 1 or level 2 as level 0 is a fire-and-forget approach.
  2. Yes, none, one, or many clients can subscribe to a topic.

Chapter 8

  1. Validating credentials inside the Wasm code is not secure because the Wasm binary is being delivered to the client. The Wasm binary can then be decompiled and the credentials can be extracted.
  2. We can always use any kind of authorization service. In general, the credentials should not be validated inside the client logic, but on any other service.
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Creative DIY Microcontroller Projects with TinyGo and WebAssembly
Published in: May 2021Publisher: PacktISBN-13: 9781800560208
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Tobias Theel

Tobias Theel works as the Technical Lead and DevOps for a German FinTech startup fino and since 2020 he has also started working for RegTech startup, ClariLab, as Lead Software Engineer. Being a software architect and an expert for Go and TinyGo alongside C# and Java, he is also iSAQB certified. Theel is a highly enthusiastic community contributor and is among the top 10% responders in C# and Unity3D as well as top 20% responders in .NET, Go, and Visual Studio on StackOverflow. When not programming for fino or ClariLab, he can be found developing games, mainly at game jams such as the Ludum Dare Jam, where he develops games from scratch within 72 hours. As an active speaker at tech talks and a participant for numerous hackathons, Theel loves to share his knowledge of software development with fellow enthusiasts.
Read more about Tobias Theel