Skip to main content

Posts

Showing posts with the label bitbot

Neuron Controlled Edge follower updated

In the last post experimentation with an artificial neuron controlling the Bit:Bot to follow the edge of a line (it follows the left-hand side of the line). More details can be found in the previous post. The neurons (well two separate ones, S1 and S2) are produced using  weighted sums - summing the  weights x inputs [ right-hand sensor (rs) and left-hand sensor (ls)] plus a bias for each neuron in this case w[0] and w[3].     net=w[0]+w[1]*rs+w[2]*ls           net2=w[3]+w[4]*rs+w[5]*ls If weighted sum >=0 then its output 1 otherwise 0 What actual causes S1 to be either 1 or 0 is all defined by a set of weights w (three for the first neurone, S1,  three for S2). w=[0,-1,1,-1,1,-1] Modifications to the code in the  last post  have been around fine tuning the values in c onverting the outputs of the two neurons S1 and S2 into actions as shown below.     if s1=...

4Tronix Bit:Bot Neuron Controlled Edge follower

In the   last post I was playing with 4Tronix's   Bit:Bot . In this post I will show the initial experimentation with an artificial neuron controlling the Bit:Bot to follow the edge of a line (it follows the left-hand side of the line). The neurons (well two separate ones, S1 and S2) are produced using weighted sums - summing the weights x inputs [ right-hand sensor (rs) and left-hand sensor (ls)] plus a bias for each neuron in this case w[0] and w[3].                         net=w[0]+w[1]*rs+w[2]*ls           net2=w[3]+w[4]*rs+w[5]*ls   If weighted sum >=0 then its output 1 otherwise 0       if net>=0:          s1=1     else:         s1=0     if net2>=0:         s2=1     else:       ...

4Tronix Bit:Bot - now there is a good idea.

When I first heard of this robot, my first thought was what a great idea; a robot with neopixels (I know I should be saying 'smart RGB LEDs' but neopixels is so much more snappier) controlled via a micro:bit. A good starting point for learning more about this robot, is the details on the 4Tronix site/blog , which includes build guidance and programming instructions for micropython and PXT. Though for the micropython code you might need to change pinX.digital_write() to pinX.write_digital()  where X is the pin number. My play code was to randomly select which neopixels to light up, I didn't include code to turn them off so multiple ones can be on. The robot is driven forwards, waits, backward, waits, turns to the right and then the left; and then repeats.  Code: from microbit import * import neopixel, random np = neopixel.NeoPixel(pin13, 12) def forward(n):     pin0.write_digital(1)     pin8.write_digital(0)  ...