Thursday, 21 January 2021

Tinkercad and Microbit: To make a neuron

The free online CAD (and so much more) package Tinkercad https://www.tinkercad.com/ under circuits; now has microbits as part of the list of basic components available to build circuits out of.

To have a quick play I wonder if using the built in Scratch=like code blocks, I could build a simulation of neuron on the microbit.

Requirements 
- By altering the bias, weights change the behaviour of buttons A and B
-when A is pressed a variable input1 is set to 1 and when released it goes to 0. The same happens for Button B and a variable input 2
- if (bias+weight1*input1+weight2*input2)>=0 then a T for True appears of the LEDs otherwise F for False is shown.

That is it really, apart initialising the variables. The code for producing an OR is shown below and the GIF at the end shows an AND in action:





The GIF below shows it action for an AND (bias is set to -2); change the bias to -1 and you would get an OR.








All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

No comments:

Post a Comment

Who wants to produce AI produced cartoon strips

Question: How easy is it produce a comic/cartoon using genetative AI? Let's start with  using ChatGPT4o to produce cartoons. The idea wa...