# data[].attributes.attachment_link.readable_text
C'est un module pour Micro:Bit qui m'a été offert par MC Hobby. Il est composé d'une LED Blanche de 10mm (reliée à la broche P0 et à une résistance de 47 Ω ) et d'un photo-transistor (reliée à la broche P1 et à une résistance de 10 KΩ ). Bien sûr, vous pouvez très facilement reproduire ce branchement avec une breadboard et quelques composants de base.

Mais le gros avantage de ce module est qu'il se fixe solidement au Micro:Bit avec les 5 vis fournies (ou même seulement 4 car la broche P2 n'est pas connectée). Fini les problèmes de faux contacts, de mauvais branchements ou de cours circuits. Vous vous concentrer seulement sur le code. Ce module, comme le STOP:bit est plutôt destiné à une utilisation pédagogique. Et je pense que si vous avez l'intention d'animé un atelier avec des enfants, vous appréciez énormément cet avantage...

Fonctionnement du module

La résistance du photo-transistor diminue quand il est exposé à la lumière. Autrement dit, il laisse plus facilement passer le courant s'il est éclairé. Le photo-transistor est un peu comme un robinet qui laisserait couler plus d'eau lorsqu'il y a de la lumière.

L'une des pattes du photo-transistor est reliée à la borne +3,3. Il suffit donc de mesurer la tension du courant (nombre de volts) qui arrive à passer jusqu'à l'autre patte pour en déduire la luminosité. C'est le rôle du Micro:Bit, la broche P1 mesure la luminosité et renvoie une valeur comprise entre 0 (obscurité) et 1023 (éclairage intense).

Source Kitronik

La broche P0 contrôle la LED, qui permet d'afficher le résultat obtenu. Mais évidement, c'est à nous d'écrire le programme. Vous trouverez donc ci-dessous quelques exemples de code :

Code de base

Il existe, dans Makecode une bibliothèque spécifique au LAMP:bit. Pour l'activer, allez dans Avancé, Extensions, tapez " lampbit " dans le champ de recherche (c'est parfois un peu long) et sélectionnez la bibliothèque " kitronik-lampbit " .

Voilà un exemple de code utilisant la bibliothèque, la LED s'allume lorsque la luminosité est inférieure à 350 . Vous pouvez évidement ajuster cette valeur (de 0 à 1023).

Mais la bibliothèque n'apporte pas grand chose, car il est possible de faire exactement la même chose en utilisant seulement les instructions classiques.

# Code MicroPython pour Micro:Bit # Appel de la bibliothèque "microbit" from microbit import * # Boucle infinie while True: # Si la luminosite est inferieure a 350 (sur 1023) if pin1.read_analog() <= 350: # Allume la LED reliee a la broche P0 pin0.write_digital(1) # Sinon else: # Eteint la LED reliee a la broche P0 pin0.write_digital(0) # Pause (1/10 de seconde) sleep(100)

Régler le seuil de déclenchement

Au lieu de définir une valeur constante pour déclencher l'allumage de la LED, vous pouvez utiliser une variable que l'on peut ensuite ajuster avec les boutons A et B.

# Code MicroPython pour Micro:Bit # Appel de la bibliothèque "microbit" from microbit import * lum = 150 # Boucle infinie while True: # Si le bouton A est appuye if button_a.was_pressed(): if (lum + 20) < 1023: # Augmente lum de 20 lum = lum + 20 else: lum = 1023 # Si le bouton B est appuye if button_b.was_pressed(): if (lum - 20) > 0: # Diminue lum de 20 lum = lum - 20 else: lum = 0 # Si la luminosite est inferieure à 350 (sur 1023) if pin1.read_analog() <= lum: # Allume la LED reliee a la broche P0 pin0.write_digital(1) # Sinon else: # Eteint la LED reliee a la broche P0 pin0.write_digital(0) # Pause (1/10 de seconde) sleep(100)

LED variable

Il est aussi possible de modifier l'intensité lumineuse de la LED pour qu'elle soit inversement proportionnelle à la luminosité ambiante. En plus, le code est beaucoup plus court.

# Code MicroPython pour Micro:Bit # Appel de la bibliothèque "microbit" from microbit import * # Boucle infinie while True: # Ajuste l'intensité de la LED en fonction de la luminosité pin0.write_analog(1023 - pin1.read_analog()) # Pause (1/10 de seconde) sleep(10)

Détecteur de lumière

Avec ce code, la fréquence de clignotement permet de mesurer l'intensité lumineuse, plus la lumière est importante et plus la LED clignote rapidement.

# Code MicroPython pour Micro:Bit # Appel de la bibliothèque "microbit" from microbit import * # Fonction Clignotement def Clignotement(): # Pause variant suivant la luminosite sleep(1100 - pin1.read_analog()) # Boucle infinie while True: # Allume la LED reliee a la broche P0 pin0.write_digital(1) # Appel de la fonction Clignotement Clignotement() # Eteint la LED reliee a la broche P0 pin0.write_digital(0) # Appel de la fonction Clignotement Clignotement()

Système de surveillance

En ajoutant un pointeur laser (ou même une simple lampe de poche), vous pouvez vous amuser à fabriquer un système permettant de savoir si quelqu'un est venu chez vous en votre absence. Dans un couloir peu éclairé (par exemple), disposez l'éclairage sur un mur et le module sur le mur d'en face. Une personne passant par là est obligée de couper le rayon lumineux, ce qui allume la LED. Une fois activée, la LED reste allumé.

Pour réactiver le piège, il vous suffit d'appuyer sur le bouton A.

# Code MicroPython pour Micro:Bit # Appel de la bibliothèque "microbit" from microbit import * # Eteint la LED reliee a la broche P0 pin0.write_digital(0) # Boucle infinie while True: # Si la luminosite est inferieure a 100 (sur 1023) if pin1.read_analog() <= 100: # Allume la LED reliee a la broche P0 pin0.write_digital(1) # Si le bouton A est appuye if button_a.was_pressed(): # Eteint la LED reliee a la broche P0 pin0.write_digital(0) sleep(100)

Système d'alarme (silencieuse)

Là, c'est le contraire, mon couteau suisse empêche la lumière d'atteindre le photo-transistor. Mais si quelqu'un tente de le voler, la LED se met à clignoter (même s'il le remet en place).

Vous pourrez remettre l'alarme à zéro en appuyant sur le bouton A.

# Code MicroPython pour Micro:Bit # Appel de la bibliothèque "microbit" from microbit import * # Desactivation de l'alarme Alarme = 0 # Boucle infinie while True: # Si la luminosite est superieure a 100 (sur 1023) if pin1.read_analog() > 100: # Activation de l'alarme Alarme = 1 # Si Alarme égale 0 if Alarme == 0: # Eteins la LED reliee a la broche P0 pin0.write_digital(0) else: # Allume la LED reliee a la broche P0 pin0.write_digital(1) # Pause de 60 millisecondes sleep(60) # Eteins la LED reliee a la broche P0 pin0.write_digital(0) # Pause de 60 millisecondes sleep(60) # Si le bouton A est appuye if button_a.was_pressed(): # Desactivation de l'alarme Alarme = 0

J'espère que ces quelques exemples vous ont amusés, je compte sur votre imagination pour en trouver d'autres. D'ailleurs, si vous avez des idées géniales, n'hésitez pas à les mettre en commentaire...

# data[].attributes.attachment_link.description
C'est un module pour Micro:Bit qui m'a été offert par MC Hobby. Il est composé d'une LED Blanche de 10mm (reliée à la broche P0 et à une résistance de 47 Ω ) et d'un photo-transistor (reliée à la broche P1 et à une résistance de 10 KΩ ).

# data[].attributes.attachment_link.readable_text
Le module Sensor Board regroupe a lui seul 3 capteurs différents. Il est capable de mesurer le volume sonore, la température et la luminosité. Cet exemplaire m'a été offert par Françoise et Dominique Meurisse de la boutique MC Hobby (et du blog du même nom). Le branchement est tellement simple que pour une fois, je n'ai pas besoin de faire un schéma :

P0 sur le capteur de son

P1 sur le capteur de température

P2 sur le capteur de lumière

Alimentation 3V et GND

Mais, pourquoi ne pas avoir fait comme pour les modules STOP:bit ou LAMP:bit de Kitronik qui se connectent si facilement au Micro:Bit avec quelques vis ?
Heureusement, ce petit " problème " est quand même facile à surmonter. Ensuite, l'utilisation du module est extrêmement simple. Je n'ai eu aucunes difficulté à reproduire les exemples présentés sur le site de Monkmakes (le fabricant du module).

Le capteur de son

Le capteur de son connecté à l'entrée analogique P0 réagit en fonction du volume sonore. Si l'environnement est silencieux, il renvoie 1,5V ce qui correspond à une valeur de 512, mais s'il détecte du bruit la valeur oscille entre 0 et 3V (c'est à dire, entre 0 et 1023 pour l'entrée P0).

Pour obtenir une représentation graphique cohérente, il faut supprimer les valeurs inférieures à 1,5V (et donc à 512, dans le code).

# Appel de la bibliothèque "microbit" from microbit import * # Boucle infinie while True: # Calcul du volume sonore (entre 0 et 5) volumeSonore = (pin0.read_analog() - 511) / 100 # Affichage du volume sonore dans la matrice de LED display.clear() for y in range(0, 5): if volumeSonore > y: for x in range(0, 5): display.set_pixel(x, 4-y, 9)

Température

Le capteur de température fonctionne selon le même principe. Il transmet une tension différente (entre 0 et 3V) suivant la température. Le Micro:Bit interprète la tension sous forme de valeur (comprise entre 0 et 1023) et il suffit ensuite d'appliquer une simple formule de calcul pour obtenir la température en degré Celsius (ou Fahrenheit).

# Appel de la bibliothèque "microbit" from microbit import * # Boucle infinie while True: display.scroll(int(pin1.read_analog() * 75 / 1000 - 14)) sleep(500)

Lumière

Le capteur de luminosité utilise un photo-transistor pour mesurer la lumière.
En théorie, la tension envoyée par le capteur devrait être comprise entre 0 et 3V, ce qui correspondrait (pour le Micro:bit) à une valeur comprise entre 0 à 1023. Mais dans la pratique, la valeur maximale envoyée par le capteur ne dépasse pas 900.
Lorsque la lumière augmente, la tension (et donc la valeur détectée par le Microbit) augmente également :

Sombre 0 à 3

À l'intérieur, salle peu éclairée 6 à 10

À l'intérieur, sous la lumière 10 à 50

À l'extérieur (temps couvert) 100 à 200

À l'extérieur (journée ensoleillée) 800 à 900

# Appel de la bibliothèque "microbit" from microbit import * # Boucle infinie while True: # Calcul du niveau de luminosite lumiere = pin2.read_analog() / 10 # Affichage de la luminosite dans la matrice de LED display.clear() for y in range(0, 5): if lumiere > y: for x in range(0, 5): display.set_pixel(x, 4-y, 9)

Conclusion

Simple et facile à utiliser, ce module s'adresse particulièrement aux débutants et à ceux qui n'aiment pas utiliser une breadboard. S'il vous intéresse, vous le trouverez dans la boutique de Françoise et Dominique ( MCHobby).

# data[].attributes.attachment_link.description
Le module Sensor Board regroupe a lui seul 3 capteurs différents. Il est capable de mesurer le volume sonore, la température et la luminosité. Cet exemplaire m'a été offert par Françoise et Dominique Meurisse de la boutique MC Hobby (et du blog du même nom). Le branchement est tellement simple que pour une fois, je...

# data[].attributes.headline
Mesurer la vitesse du son avec un micro:bit

# data[].attributes.subject
Mesurer la vitesse du son avec un micro:bit

# data[].attributes.attachment_link.readable_text
Un guide de l'évaluation au service des apprentissages des lycéens est publié sur Éduscol. Il expose à la fois des principes communs, des préconisations par discipline et par spécialité ainsi que des préconisations pour le pilotage général de l'évaluation. Toutes les formes d'évaluation possibles sont prises en considération dans le cadre des enseignements ainsi que la diversité de leurs rôles.
Le guide prend en compte la suppression des évaluations communes dont la conséquence est l'intégration, à la (...)

# data[].attributes.attachment_link.title
Numérique et sciences informatiques SNT et NSI - Académie de Normandie

# data[].attributes.attachment_link.description
Un guide de l'évaluation au service des apprentissages des lycéens est publié sur Éduscol. Il expose à la fois des principes communs, des préconisations par discipline et par spécialité ainsi que des préconisations pour le pilotage général de l'évaluation. Toutes les formes d'évaluation possibles sont prises en considération dans le cadre des enseignements ainsi que la diversité de leurs rôles.

# data[].attributes.body
Capture de données avec micro:bit et Xinabox et internet des objets

# data[].attributes.attachment_link.readable_text
Acceleration is what makes an object change its velocity: when a force of sufficient strength is applied to an object and makes it slow down, speed up or change direction acceleration has occurred. It is a fundamental characteristic of our experience of the world and a core concept in the mental tool box we use to make sense of that world.

Not only is it exhilarating to experience, it is also fascinating and educational to analyse. Being able to visualise the forces associated with dropping or throwing a ball, or an accelerating rocket, or seeing what happens when a moving object hits a wall, provide unique insights into this building block of creation.

The project will show you how to use a micro:bit and IoT to analyse acceleration over a time period. You can use the code and techniques described here to measure the acceleration that applies to any moving object that you can fix a micro:bit to.

Below is an example of a visualistion of acceleration: the chart shows real data from an object moving in a plane. I won't say much more about it right now - I encourage you to look at the acceleration profile and try to infer what is going on (e.g. is it a ball bouncing, or a head rolling, or something else?). The final section of this blog reveals the real world event that is represented below.

One of the great features of the BBC micro:bit is it's onboard accelerometer. Many a young learner has spent loads of productive time reading data from the accelerometer and using it in all sorts of creative ways. I've seen countless RC cars that are controlled by tilting, gloves that act as controllers, some very clever balancing robots and even gesture based musical 'instruments'.

But the accelerometer also has great potential as a learning tool to support the perennial speed / distance / time triangle that is so important, ostensibly in physics but in so many spheres of knowledge. What better way to teach acceleration than by getting young learners to witness an event, then review the forces behind that event?

In this blog I am going to show you how to:

Use a micro:bit to collect a pile of accelerometer readings. This micro:bit will collect the data 'remotely', which means it will collect the data during the event and store it on the micro:bit, to share later (I'll explain why in a bit).

Once the event we are measuring is complete, we'll then use the Wi-fi based XinaBox IoT starter kit for micro:bit (which I refer to here as our micro:bit gateway) to take that data and to transfer it to an IoT platform.

For this example we will throw a ball between 2 people then fling the data onto the Ubidots IoT platform.

Why collect raw accelerometer data remotely?

The micro:bit includes radio functionality, which can be used to enable a Bluetooth connection between a micro:bit and another device (NOT another micro:bit though).

In some circumstances it is possible to transmit the data as you collect it, using either radio or BT. This approach did not suit the circumstances that led to this blog though. When I was asked to look at the real world problem that generated the chart at the beginning there were some specific challenges to consider:

It was critical that the data did not get lost. I needed to store the data during the run, then extract it later. I could not afford for radio packets to go missing or for a BT connection to drop out. Saving the data during the run means we can retrieve it at our leisure afterwards, and if that data retrieval fails we can keep trying.

For reasons I will briefly explain later, during the acceleration event (which I will call a run henceforth) I wanted to use ALL of the processor power to take accelerometer readings. If I transmit the data during the run it reduces the amount of data we can sample, which impacts on the quality of the data.

I wanted to store a LOT of data so I needed to ensure minimal memory was being used by non-essential processes. The production-level data collection program (not included here) really stretches the little micro:bit to its limits!

The object that is moving in the run moves over quite a distance. It is risky to have a receiver in a fixed location. Think of it this way - the code here could be used to measure acceleration of a body being dropped from a height. The code could be adapted to read data for 10 seconds or more, and in that time a body will have fallen a long way from where you dropped it.

So, I've gone with the following workflow:

Taking the measurements

Flash the attached microPython code Catch_Collector_Simple or Catch_Collector_Advanced onto a micro:bit.

Connect it to a battery pack

Cut a hole in your ball that is big enough to fit the micro:bit and battery pack into.

Pack the loose space in the ball with a filler (I used bubble-wrap, which I hoard!)

Once the ball is built do the following to activate it:

Click the reset button to clear out any old data, then click the A-button

A countdown from 3 will commence - at the end of the countdown a full stop is shown on the LEDs indicating that the micro:bit is taking measurements. Throw the ball during this period.

Once the measurement phase is complete a small square is shown on the LEDs. The sample code will record data for about 3 seconds, but you can tweak the code to extend or reduce this.

When you click the B-button it will initiate the process of transferring data to the micro:bit gateway.

The difference between the Simple and the Advanced versions lies in the data collection technique. For both, 1 reading is saved every 25ms (which amounts to 40 readings per second). For the Simple version we read the accelerometer just once every 25ms, but the Advanced code will read the accelerometer up to 75 times in this 25ms period. We then save a single value that is the average of all 75 readings. This 'smooths' out the data: it reduces outliers and gives a decent approximation of the acceleration across the whole 25ms period. The difference in data quality is marked and I encourage you to check this yourself: try a few times with both versions of the code and look at the data charts. You can read a lot more detail about this method, when to use it and why it is effective here on my blog.

If you look at the code you will notice that I am recording acceleration in the y-plane. For the real world scenario that I developed this code for that was adequate as the micro:bit was moving in that plane. When it comes to throwing the ball, though, the forces acting in the y-plane will be in part determined by the orientation of the micro:bit when you throw it. Consider adapting the code to record x and z readings and also ways that you can throw the ball in such a way that the acceleration acts in plane you are recording.

You may also notice that the code provided takes 120 readings. With 1 reading every 25ms this amounts to 3 seconds of data collection. You can play around with this. I found that it was possible to record up to 400 data points in this way. My production code used a file to store the data, rather than a list. Both ways have their pros and cons, which I won't elaborate on here (but please ask if you are interested).

The micro:bit gateway + IoT Platform

You will need to do the following:

Build and setup a micro:bit gateway.

Connect to an IoT platform

I'd recommend having a look at this blog, which contains all the info you need to get connected.

Before completing the experiment ensure your gateway is powered up and connected to Ubidots.

Note that the microPython code in the gateway for this project is almost identical to the code used in the other blogs I've written. Adapting it for each circumstance is relatively easy. When MakeCode blocks are released (soon!) this process will be greatly simplified.

Putting it all together

Set up and throw the ball, as described.

When measuring is complete, ensure your ball micro:bit is within range of the micro:bit gateway (a couple of meters should do).

Ensure your gateway is ready to receive data.

Click the B-button on the ball

Sit back and watch the process unfold. Its fun to watch the data accumulate in Ubidots.

My code takes about a minute to transmit all the data to the IoT platform. This can be reduced significantly.

The reason it takes so long is that I have been very cautious - I spent some time adjusting the various sleep commands, and when I found a mix that worked consistently I left it at that. I would love to see it working much more quickly, so if you crack this please get in touch and let me know how.

Analysing the chart from the beginning

Lets take another look at the chart from the beginning of the blog. This time I've put some lines in to mark the interesting 'phases':

Phase 0: The object is at rest.

Phase 1: A rapid (you might even say, explosive) acceleration is applied. It peaks at the point marked, but the object speeds up throughout this period. At the end of this period the object has reached its maximum speed

Phase 2: At the beginning of this period the forces slowing down the object have exceeded those accelerating it, and a rapid deceleration occurs.

Phase 3: The data here is a bit 'noisy' - the object is decelerating for most of the period, so the object slows down in this phase. Occasional changes to the rate of deceleration are interesting.

Phase 4: A rapid deceleration occurs, followed by an equally rapid decrease in that deceleration, until it reaches zero. The object has encountered a barrier that is not a solid wall, but which brought it very quickly to a stop.

Phase 5: the object is once again at rest.

Have you guessed what it is yet?

It is a rocket powered car. In Phase 1 the rocket engine fires, then stops firing and we enter Phase 2. This phase sees forces of resistance work strongly against the car. In Phase 3 the car bounces a bit, perhaps sometimes leaving the ground and going briefly into freefall (which might explain the minor acceleration noted in that period, idk?). In Phase 4 it then hits a specially designed breaking system which slows it to dead stop in about 1.5 meters.

# data[].attributes.attachment_link.title
Data Capturing with micro:bit, XinaBox and IoT

# data[].attributes.attachment_link.description
Acceleration is what makes an object change its velocity: when a force of sufficient strength is applied to an object and makes it slow down, speed up or change direction acceleration has occurred. It is a fundamental characteristic of our experience of the world and a core concept in the mental tool box we use to make sense of that world.

# data[].attributes.headline
Débuter en micropython avec le micro:bit

# data[].attributes.subject
Débuter en micropython avec le micro:bit

# data[].attributes.attachment_link.readable_text
Le langage Python, créé en 1991, sous licence libre est actuellement très populaire. C'est notamment le langage phare du Raspberry Pi.
Le MicroPython est une adaptation du langage Python pour microcontrôleurs. Il a été à l'origine créé pour programmer la , une carte de développement lancé sur Kickstarter en 2013. Mais maintenant, d'autres puces peuvent être programmées en MicroPython, comme par exemple le ou le Circuit Playground Express (dont je vous parlerai prochainement).
Pour résumer, disons simplement que MicroPython est une version simplifiée de Python, spécialement destinées aux microcontrôleurs.

Les éditeurs

Si vous souhaitez vous initier au MicroPython avec le Micro:Bit, vous pouvez vous contenter de l'éditeur de la fondation. Il est intuitif et ne nécessite pas d'installation. Mais n'oubliez pas de sauvegarder vos fichiers texte (format *.py) sur votre disque dur, car contrairement à MakeCode ils ne sont pas automatiquement stockés par le navigateur internet (et les fichiers *.hex sont compilés, ils ne sont donc pas modifiables).

Pour travailler plus confortablement, je vous conseille d'installer sur votre ordinateur un véritable éditeur, comme Mu qui est gratuit, multiplateforme, intègre automatiquement les bibliothèques microbit et permet de Flasher directement le Micro:Bit.

Le passage des blocs au texte

Si vous êtes habitué à la programmation par blocs (MakeCode, Scratch, mBlock...) le passage au texte peut être un peu intimidant, car vous vous retrouvez devant une page vide et c'est à vous de taper le code. Mais ne vous inquiétez pas, le principe est exactement le même.
Regardez dans l'exemple ci-dessous, chaque ligne correspond à un bloc :

Bien sûr, il faut quand même apprendre un nouveau langage. Mais c'est de l'anglais très rudimentaire et vous n'avez pas besoin d'étudier toutes les instructions pour débuter dans la programmation. Au contraire, il est beaucoup plus facile d'apprendre progressivement, au gré de vos besoins.

Les grands principes du langage Python

Pour bien débuter en Python (ou MicroPython), vous devez connaitre quelques principes de base :

1) Les commentaires
Si le texte est précédé du caractère " #" , il ne sera pas pris en compte par le Micro:Bit (jusqu'au saut de ligne suivant). Cela permet d'ajouter des informations qui facilitent la compréhension du programme. Mais les commentaires sont également très utiles pour désactiver certaines lignes de codes afin de tester la modification du programme ou pour rechercher la cause d'un dysfonctionnement ( bug ou bogue).

2) Les bibliothèques
Le langage Python est utilisé dans de nombreux domaines. Mais il est très rare d'avoir besoin de toutes les instructions en même temps. Elles sont donc regroupées par thèmes dans des bibliothèques. Par exemple pour programmer le Micro:bit, il faudra appeler la bibliothèque contenant les instructions spécifiques à cette carte. Mais si le programme doit fonctionner sur Raspberry Pi, il faudra d'autres bibliothèques.

# Appel de la bibliothèque "microbit" (toutes les instructions)
from microbit import *

3) L'indentation.
Cela consiste à ajouter des espaces (ou une tabulation) au début de la ligne, pour décaler les instructions situées à l'intérieur d'une condition, d'une boucle ou d'une fonction. Dans d'autres langages, comme le langage Arduino (basé sur le langage C) l'indentation est facultative, elle est seulement conseillée afin faciliter la lecture (ou la relecture) du code.
Attention, en Python l'indentation est obligatoire.
# Exemple d'indentation (avec une boucle infinie)
from microbit import *
while True:
 display.show(Image.HEART)
 sleep(500)
 display.clear()
 sleep(500)

La matrice 5×5

La documentation MicroPython pour MicroBit (en Français) est disponible ici. Vous y trouverez la liste des images intégrées à la bibliothèque " microbit " . Par exemple, pour afficher un coeur, il suffit de taper le code suivant :

# Appel de la bibliothèque "microbit"
from microbit import *
# Affichage de l'image
display.show(Image.HEART)

Mais vous pouvez aussi dessiner vos propres symboles pixel par pixel. Le chiffre représente l'intensité lumineuse de la LED. À 0 la LED est éteinte, à 9 elle éclaire au maximum mais évidement, vous pouvez aussi utiliser les chiffres intermédiaires (1, 2, 3, 4, 5, 6, 7 ou 8).

Dans l'exemple ci dessous, le 1er pixel (à gauche sur la 1ère ligne) est à 0, le pixel suivant est à 9, le 3ème à 0 et ainsi de suite jusqu'au 5ème pixel de la ligne. Puis on définit la 2ème ligne (où tous les pixels sont à 9). Et cela continue jusqu'à la 5ème et dernière ligne. Nous avons donc défini une images en indiquant l'un après l'autre, l'état des pixels qui la compose.

# Appel de la bibliothèque "microbit"
from microbit import *
# Définition de l'image
coeur = Image("09090:"
 "99999:"
 "99999:"
 "09990:"
 "00900")
# Affichage de l'image
display.show(coeur)

Une fois que vous avez compris le principe, vous pouvez utiliser cette notation qui est plus compacte, mais donne exactement le même résultat.

# Appel de la bibliothèque "microbit"
from microbit import *
# Définition de l'image
coeur = Image("09090:99999:99999:09990:00900")
# Affichage de l'image
display.show(coeur)

Ensuite, vous pouvez créer une animation composée d'images légèrement différentes. Dans un 1er temps, vous définissez chaque image, puis vous créez un tableau définissant l'animation (l'ordre de successions des images). Et enfin, vous pouvez afficher l'animation à l'intérieur d'une boucle infinie (une boucle qui se répète indéfiniment).
Faites bien attention à l'indentation.

# Appel de la bibliothèque "microbit"
from microbit import *
# Définition des images
c1 = Image("01010:11111:11111:01110:00100")
c2 = Image("02020:22222:22222:02220:00200")
c3 = Image("03030:33333:33333:03330:00300")
c4 = Image("04040:44444:44444:04440:00400")
c5 = Image("05050:55555:55555:05550:00500")
c6 = Image("06060:66666:66666:06660:00600")
c7 = Image("07070:77777:77777:07770:00700")
c8 = Image("08080:88888:88888:08880:00800")
c9 = Image("09090:99999:99999:09990:00900")
# Définition de l'animation
battementsCoeur =[c1,c2,c3,c4,c5,c6,c7,c8,c9,c8,c7,c5,c4,c3,c2]
# Boucle infinie
while True:
 # Affichage de l'animation (100 millisecondes entre chaque image)
 display.show(battementsCoeur, delay=100)

Vous pouvez aussi afficher du texte.

# Appel de la bibliothèque "microbit"
from microbit import *
# Boucle infinie
while True:
 # Affichage du traditionnel message "Hello World"
 display.scroll("Hello World")

Les boutons

Pour utiliser les boutons, il faut créer une boucle infinie, dans laquelle le Micro:bit vérifie en permanence si l'on a appuyé sur un des boutons.

# Appel de la bibliothèque "microbit"
from microbit import *
# Boucle infinie
while True:
 # Si le bouton A est appuyé
 if button_a.is_pressed():
 # Affiche l'image "coeur"
 display.show(Image.HEART)
 # Sinon
 else:
 # Éteins toutes les LED de la matrice
 display.clear()

Ensuite, il est possible de compliquer un peu les choses en testant successivement les 2 boutons (A et B)

# Appel de la bibliothèque "microbit"
from microbit import *
# Boucle infinie
while True:
 # Si le bouton A est appuyé
 if button_a.is_pressed():
 # Affiche l'image "coeur"
 display.show(Image.HEART)
 # Sinon et si le bouton B est pressé
 elif button_b.is_pressed():
 # Affiche l'image "petit coeur"
 display.show(Image.HEART_SMALL)
 # Sinon
 else:
 # Éteins toutes les LED de la matrice
 display.clear()

Vous connaissez maintenant les bases du langage MicroPython. Mais nous en reparlerons dans les prochains articles.

# data[].attributes.attachment_link.description
Le langage Python, créé en 1991, sous licence libre est actuellement très populaire. C'est notamment le langage phare du Raspberry Pi.Le MicroPython est une adaptation du langage Python pour microcontrôleurs. Il a été à l'origine créé pour programmer la Pyboard, une carte de développement lancé sur Kickstarter en 2013.

# data[].attributes.headline
liaison bluetooth entre raspberry pi et microbit

# data[].attributes.subject
liaison bluetooth entre raspberry pi et microbit

# data[].attributes.attachment_link.readable_text
Setting Up the micro:bit

We will use https://makecode.microbit.org to create our own hex file with the required Bluetooth services for this workshop.

If there are not the Bluetooth commands on the left hand side then click on the cog and choose Extentions. From the list of Extensions, choose Bluetooth and accept that radio will be replaced with Bluetooth.

Before saving the program to the micro:bit, click on the cog and select Project Settings. Choose the JustWorks pairing mode.

The micro:bit with this hex file will need to paired with the Raspberry Pi, more on that later. For now we are done with the micro:bit and can switch to setting up the Raspberry Pi.

Setting up the Raspberry Pi

You will need to install the Bluezero package from Python Package Index (PyPI). These instructions are targeted at a Raspberry Pi running a Raspbian Stretch release:
sudo pip3 install bluezero

Pairing with the micro:bit

If this is the first time this combination of Raspberry Pi and micro:bit have been used together then you will need to ensure the micro:bit is in the list of known Bluetooth devices that are paired with the Raspberry Pi. The pairing will be done using bluetoothctl.

Note: There is 'tab' command completion on commands and addresses available within the bluetoothctl tool.

Note: As Bluetooth addresses are unique, this workshop will representation the Raspberry Pi and micro:bit addresses as xx:xx:xx:xx:xx:xx and yy:yy:yy:yy:yy:yy respectively. Please replace these with the actual address of your devices

Using bluetoothctl

The command line tool "bluetoothctl" to discover the micro:bit.
On the terminal command line type:
$ bluetoothctl

The new prompt will be:
[bluetooth]#

Type help to get a full list of the commands.
Check that the Bluetooth is switched on on the Raspberry Pi
Typeshow and check that you have Powered: yes.
For example:

Controller xx:xx:xx:xx:xx:xx
	Name: raspberrypi
	Alias: raspberrypi
	Class: 0x000000
Powered: yes Discoverable: no Pairable: yes UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) Modalias: usb:v1D6Bp0246d052E Discovering: no

If "Powered" is not set to "yes" then type power on

Make a note of the controller address as you will need it later

Scan for micro:bit

You will need to get bluetoothctl to search for micro:bits that are nearby.
When you see your micro:bit you can stop the search.

[bluetooth]#scan on Discovery started [CHG] Controller xx:xx:xx:xx:xx:xx Discovering: yes [NEW] Device yy:yy:yy:yy:yy:yy BBC micro:bit [?????] [bluetooth]#scan off

Pair with micro:bit

Using the Bluetooth address of the micro:bit (found with the above command) to connect to it.
Because pairing is required with this hex file the micro:bit needs to be put into pairing mode. To do this, hold button A & B and then press and release the reset button on the back of the micro:bit. Once the Bluetooth logo is displayed on the micro:bit you can release all the buttons.

[bluetooth]#pair yy:yy:yy:yy:yy:yy Attempting to pair with yy:yy:yy:yy:yy:yy [CHG] Device yy:yy:yy:yy:yy:yy Connected: yes [CHG] Device yy:yy:yy:yy:yy:yy Connected: no [CHG] Device yy:yy:yy:yy:yy:yy Paired: yes Pairing successful

If you want to check the micro:bit has been added to the devices list then type devices

You have finished with bluetoothctl so type exit

Using Python with Bluezero Library

Sending a message to the micro:bit

This first Python exercise is to send text to display on the micro:bit.

from bluezero import microbit
ubit = microbit.Microbit(adapter_addr='xx:xx:xx:xx:xx:xx',
                         device_addr='yy:yy:yy:yy:yy:yy',
                         accelerometer_service=True,
                         button_service=True,
                         led_service=True,
                         magnetometer_service=False,
                         pin_service=False,
                         temperature_service=True)
my_text = 'Hello, world'
ubit.connect()

while my_text is not '':
    ubit.text = my_text
    my_text = input('Enter message: ')

ubit.disconnect()

Reading a button press

Display an image of which button needs pressing to break out of the loop

import time
from bluezero import microbit
ubit = microbit.Microbit(adapter_addr='xx:xx:xx:xx:xx:xx',
                         device_addr='yy:yy:yy:yy:yy:yy',
                         accelerometer_service=True,
                         button_service=True,
                         led_service=True,
                         magnetometer_service=False,
                         pin_service=False,
                         temperature_service=True)
ubit.connect()
while ubit.button_a < 1:
    ubit.pixels = [0b00000, 0b01000, 0b11111, 0b01000, 0b00000]
    time.sleep(0.5)
    ubit.clear_display()

while ubit.button_b < 1:
    ubit.pixels = [0b00000, 0b00010, 0b11111, 0b00010, 0b00000]
    time.sleep(0.5)
    ubit.clear_display()

ubit.disconnect()

Reading values from the micro:bit

This last exercise uses information from the micro:bit sensors to be displayed ont he Raspberry Pi.

Pressing Button A prints if the micro:bit is face-up or face-down

Pressing Button B print the temperature from the micro:bit

Pressing Button A & B exits the code

import time
from bluezero import microbit

ubit = microbit.Microbit(adapter_addr='xx:xx:xx:xx:xx:xx',
                         device_addr='yy:yy:yy:yy:yy:yy',
                         accelerometer_service=True,
                         button_service=True,
                         led_service=True,
                         magnetometer_service=False,
                         pin_service=False,
                         temperature_service=True)
looping = True
ubit.connect()
print('Connected... Press a button to select mode')
mode = 0
while looping:
    if ubit.button_a > 0 and ubit.button_b > 0:
        mode = 3
        ubit.pixels = [0b10001, 0b01010, 0b00100, 0b01010, 0b10001]
        time.sleep(1)
    elif ubit.button_b > 0:
        mode = 2
        ubit.pixels = [0b11111, 0b00100, 0b00100, 0b00100, 0b00100]

        time.sleep(0.25)
    elif ubit.button_a > 0:
        mode = 1
        ubit.pixels = [0b11110, 0b10000, 0b11100, 0b10000, 0b10000]
        time.sleep(0.25)

    if mode == 1:
        x, y, z = ubit.accelerometer
        if z < 0:
            print('Face up')
        else:
            print('Face down')
        time.sleep(0.5)
    elif mode == 2:
        print('Temperature:', ubit.temperature)
        time.sleep(0.5)
    elif mode == 3:
        looping = False
        print('Exiting')

ubit.disconnect()

# data[].attributes.attachment_link.description
We will use https://makecode.microbit.org to create our own hex file with the required Bluetooth services for this workshop. If there are not the Bluetooth commands on the left hand side then click on the cog and choose Extentions. From the list of Extensions, choose Bluetooth and accept that radio will be replaced with Bluetooth.

# data[].attributes.attachment_link.readable_text
Well, making a calculator with THREE micro:bits really. This is, I admit, a bit of a mad project but I've been fascinated by calculators since childhood. I can remember cheap pocket calculators being invented and, like digital watches, I still think they are a pretty neat idea.

Inspired by Philip Meitiner's keypad micro:bit calculator, I wondered if I could make one just using micro:bits. My first sketch used NINE micro:bits in a grid, which I then decided was utterly bonkers, so I cut it down to three (though you could do this project with two, but I like three. It's the magic number, don't you know?)

This was quite a pleasant Easter Sunday intellectual diversion, and I have a new-found respect for designers of humble adding machines: it's harder than it looks.

Here's how it works. The top micro:bit is the display which shows entered numbers and operators. The left button A is the clear button. The right button B is the '=' button (equals, calculate, evaluate, work it out!)

Underneath it are two more micro:bits. The one on the left does numbers, the one on the right sends operators. Using the A button, you scroll through each possible number (0 through to 9 and . for decimal point) and operators (+,-,/ and *). When you found have the number you want to send, you press button B to transmit it over radio to the display. Press button B on the display micro:bit to calculate the result - if it's longer than a single digit it scrolls, but you can press button B again if you missed it.

I had to think quite hard about how a calculator's UI works and how it knows when to perform the actual calculation. My solution doesn't emulate a real calculator - it doesn't have a keypad for one thing. It builds up a string of numbers and operations until you press the = button, then it evaluates the string. If there's no operator, pressing = does nothing. If there is no second number, it does nothing. If there is an operator in the string and 2 numbers it will perform the calculation.

I'm sure the code can be made more elegant but I'm quite pleased with it. It copes with decimal numbers, if you don't have an operator or a second number it doesn't error but waits for you to add them. Perhaps you could add more mathematical functions? Error handling for more than 2 numbers or division by zero?

Here's a short video showing how it works in practice:

This is the program you flash to the number encoder:

from microbit import *
import radio
radio.on()
numbers = ["0","1","2","3","4","5","6","7","8","9","."]
x = 0

while True:
    if button_a.was_pressed():
        x += 1
        if x > 10:
            x = 0
        display.show(numbers[x])
    if button_b.was_pressed():
        radio.send(numbers[x])

This is the program you flash to the operator encoder:

from microbit import *
import radio
radio.on()
operators = ["+","-","/","*"]

x = 0

while True:
    if button_a.was_pressed():
        x += 1
        if x > 3:
            x = 0
        display.show(operators[x])
    if button_b.was_pressed():
        radio.send(operators[x])

And finally, this is the program you flash to the display micro:bit:

from microbit import *
import radio
radio.on()
calc_string = ""

def displayResult():
    result_string = str(result)
    if result_string[-2:] == ".0":    # strip trailing .0 from whole numbers
        result_string = result_string[:-2]
    if len(result_string) == 1:
        display.show(result_string)   # show single digits
    else:
        display.scroll(result_string) # scroll longer numbers

while True:
    incoming = radio.receive()
    if incoming:
        display.show(incoming)
        calc_string = calc_string + incoming
    if button_a.was_pressed():   # clear button
        calc_string = ""
        a = None
        b = None    # destroy b so you can test it exists later
        display.show("0")
    if button_b.was_pressed():   # equals button
        if "+" in calc_string or "-" in calc_string or "/" in calc_string or "*" in calc_string:
            z = 0
            for char in calc_string:
                if char in "+-/*":
                    operator = char
                    a = calc_string[:z]   # a is everthything before the operator
                    b = calc_string[z+1:] # b is everything after the operator
                z += 1
            if operator == "+" and b: # check 2nd number exists before displaying result
                result = float(a) + float(b)
                displayResult()
            if operator == "-" and b:
                result = float(a) - float(b)
                displayResult()
            if operator == "*" and b:
                result = float(a) * float(b)
                displayResult()
            if operator == "/" and b:
                result = float(a) / float(b)
                displayResult()
        else:
            print("no operator")

# data[].attributes.attachment_link.description
Well, making a calculator with THREE micro:bits really. This is, I admit, a bit of a mad project but I've been fascinated by calculators since childhood. I can remember cheap pocket calculators being invented and, like digital watches, I still think they are a pretty neat idea.

# data[].attributes.attachment_link.readable_text
This is a much-simplified version of the MakeCode Hot/Cold game using Python. You hide beacons, players have to find them.

You will need:
- 2 or more micro:bits with battery packs
- a computer with which to program them
- optional: headphones or micro:bit speakers

You can hide as many beacons as you want. Using Mu or the online Python editor you put the following Python program on the beacons, changing the ID number so each is unique. Beacons constantly transmit their ID numbers as a string and show their ID number on their displays:

from microbit import *
import radio
id = "1"
display.show(id)
radio.config(power=0) # low power so you must get close
radio.on()

while True:
    radio.send(id)

In the very simplest version of this game (which should work with the online Python editor or current releases of the Mu Python editor) the players use the following program. This displays an X until a signal is received from a beacon - it should show the beacon's number for half a second every time it gets a signal. Even though the beacon is set to transmit on low power, it will still get a signal if you are a metre or two away, so this is best played over a large area:

from microbit import *
import radio
radio.on()

while True:
    message=radio.receive()
    display.show(Image.NO)
    if message:
        display.show(message)
        sleep(500)

Players should see how many beacons they can find in an allotted time. This simple player code doesn't log them, it just relies on memory and trust!
WORK IN PROGRESS: More sophisticated versions of player code showing signal strength below require Beta version of Mu 1.0.0 beta 15 or higher
This next version of the player code ignores the ID but displays a number from 1 to 5 showing how strong the signal is. X means no signal received. You could use this to play the game in a smaller area, and you could still use multiple beacons but their IDs are not shown to the player - until they find the beacon of course, when they can read its own display!

from microbit import *
import radio
radio.on()

while True:
    message=radio.receive_full()
    if message:
        strength = message[1]+100
        displaystrength = (int((strength/10)+1))
        display.show(str(displaystrength))
        sleep(200)
    else:
        display.show(Image.NO)

Now to be a bit more like a metal detector, it would be nice to have some audio feedback. This next program will play a short note when it receives a signal. The stronger the signal, the higher the pitch, so you can use this to find the beacon.

Attach a micro:bit speaker to the GND and 0 pins. CAUTION: if you attach normal headphones DO NOT WEAR THEM, just put them round your neck just like Lance and Andy in the photo at the top of this page - the sound is very loud. Or put a 3K ohm resistor between pin 0 and the headphones.. You could have some fun making a 'metal detector' as I did in the picture above with an old broom handle and some rubber bands.

Here's the program for the noisy version. As before, this currently needs a beta version of Mu to flash this to your microbits.

from microbit import *
import radio,music
radio.on()

while True:
    message=radio.receive_full()
    if message:
        strength = message[1]+100
        displaystrength = (int((strength/10)+1))
        display.show(str(displaystrength))
        music.pitch(strength*50,100)
    else:
        display.show(Image.NO)

If you try this out and have ideas for improvements, please let me know!

To do:
- Add logging of beacon numbers and some visual feedback on players' micro:bits when all beacons found.

This entry was posted in computers, microbit and tagged Microbit, Python. Bookmark the permalink.

# data[].attributes.attachment_link.description
This is a much-simplified version of the MakeCode Hot/Cold game using Python. You hide beacons, players have to find them. You will need: - 2 or more micro:bits with battery packs - a computer with which to program them - optional: headphones or micro:bit speakers You can hide as many beacons as you want.

# data[].attributes.attachment_link.readable_text
Vous connaissez certainement le jeu Pierre Papier Ciseaux ?
Si vous n'êtes pas trop sûr, vous pouvez vous rafraichir la mémoire ici.

Le site de MakeCode propose un tutoriel pour y jouer tout seul (j'en ai déjà parlé dans la présentation de l'éditeur MakeCode). Mais moi, je vous propose une version un peu différente de ce jeu, car elle contient une combinaison de touches (secrète) qui permet de tricher.

Évidemment, le but n'est pas ici de se lancer dans une carrière d'escroc avec ce pauvre Micro:bit. Mais surtout de faire une petite blague à vos enfants, qui une fois au courant du " truc " vont s'empresser d'aller piéger quelqu'un d'autre. Vous pouvez aussi présenter ça comme un tour de magie numérique qui permet de gagner à tous les coups.

Mais, si vous voulez aborder un angle un peu plus sérieux, vous pouvez engager une réflexion sur les objets connectés, qui sont potentiellement capable d'envoyer nos données à des tiers à notre insu. Ou sur le code source qui devrait toujours être connu de l'utilisateur (ou au moins accessible).

Principe de fonctionnement

Vous avez besoin de 2 MicroBits. Chaque joueur choisi secrètement son symbole et au signal, les 2 personnes le révèle en même temps.
En appuyant sur les boutons A ou B, vous faites défiler à l'écran (la matrice 5×5), les 3 symboles (pierre, papier ou ciseaux). Théoriquement vous avez autant de chances que votre adversaire de gagner, mais le Micro:bit transmet discrètement l'information en bluetooth à son homologue. Le " truc" , consiste à appuyer en même temps sur les boutons A et B pour que le Micro:bit choisisse automatiquement le symbole qui vous fera gagner.

Tuto

Pour commencer, nous allons créer une fonction que j'ai appelé " affichage"

Ensuite, vous ne devriez pas avoir de difficultés pour reproduire le code ci-dessous et de le transférer dans les Micro:bits.

Et voilà, le piège est en place, il ne vous reste plus qu'à chercher de pauvres petites victimes naïves et innocentes... Ha ! Ha ! Ha ! Ha ! Ha ! ( rire maléfique).

# data[].attributes.attachment_link.description
Vous connaissez certainement le jeu Pierre Papier Ciseaux ?Si vous n'êtes pas trop sûr, vous pouvez vous rafraichir la mémoire ici. Le site de MakeCode propose un tutoriel pour y jouer tout seul (j'en ai déjà parlé dans la présentation de l'éditeur MakeCode). Mais moi, je vous propose une version un peu différente de ce...

# data[].attributes.attachment_link.readable_text
Since its conception the BBC micro:bit has flirted with Wi-Fi - some of the early concepts even included Wi-Fi on the board. In the end they went with BlueTooth, which is an amazing feature that has served micro:bit and the community with distinction.

But its not Wi-Fi.

Over the years there have been attempts to emulate IoT on the micro:bit, and there are a few products that offer a Wi-Fi based IoT solution. But they are typically expensive, a bit hacky and not well supported or aimed at educators.

All that is about to change!

Right now the "BBC micro:bit IoT Starter Kit by XinaBox" is storming its way towards the market (you can already buy the components listed in this project separately). I declare an interest - I am helping to develop this product, a fact I am very proud of!

This little project is a simple demo of how the basic hardware can get you onto an IoT cloud with minimal hassle and minimal outlay of $$. For this project I have connected to HiveMQ because they offer a free service we can use without registering. It is possible to connect to other services, and some of the commented code will help you... I'll update this project with guidelines for other IoT platforms some time.

What you are seeing here is the tip of the iceberg: we have a very exciting roadmap, and the consumer version will be a LOT simpler (e.g. the CW01 will come pre-flashed with the necessary code, we are developing blocks for MakeCode and we'll have a smart array of learning materials to go with it).

To get this project to work you will need to work through each of the instruction sheets in turn (they print nicely on an A4 if the browser view is too zoomed in). There are 6 altogether, and it is best to work through them in this order:

1 = Flashing the CW01

2 = Flashing the micro:bit

3 = Assembling the IoT Starter Kit

4 = Setting up an IoT Service

Once you've worked through these, check out these:

5 = Pulling it all together (1)

6 = Pulling it all together (2)

Troubleshooting:

The steps described here worked for me and I am an IoT beginner at best. I did run into a few stumbling blocks - I've tried to detail these in the instruction sheets, and in some cases in the bullets below. If you encounter any difficulties and these don't help please get in touch.

Get the Wi-Fi name and password spot on in the Python code! And bear in mind, some Wi-Fi networks have extra security that might block you.

Put a slash at end of the Connect / Add New Topic / Topic prompt in the Hive dashboard setup. Thanks again Bjarke ;) Hive is very sensitive to /s.

I cut down the delays that Bjarke had put in the Python code (that you flash onto the micro:bit). " 5000ms delay - nah - I'm not waiting that long!.". Some of the delays NEED to be there, some probably not. But, when you are setting it up initially leave them be. Takes Wi-Fi a bit of time to do stuff sometimes, apparently!

Getting the orientation of the hardware components right is important (I plugged my micro:bit in upside down!). See the instruction sheet titled "Pulling it all Together (1)" for a pic of what an xCircuit should look like and what to look for to ensure your components are oriented correctly.

Power. Wi-Fi is hungry. I used a power-bar to power both the CW01 and the micro:bit and it worked fine. It also worked off of USB when the IP01 was plugged in directly. If that doesn't work try plug a battery into the micro:bit and plug your IP01 into a USB power source. The XinaBox range has some options here too. Look out for our LoRaWAN equivalent soon :)

The xFlasher is a useful tool to help you see what is going on with the CW01 - it reports status in real time. Start xFlasher up, then plug in your IP01, then click on the big SERIAL button. You should get live status updates from the CW01 which will help diagnose any problems.

Woah - the data is crazy and why am I receiving weird messages??? Bear in mind the service I've used here is free - and that anyone who uses the code EXACTLY as provided will connect to the SAME service. So no sending naughty 5x5 pics or rude messages over the default channel please ;)

And remember - this is a beta. 75% of the hassle will be removed for the commercial Educators version.

Thanks

# data[].attributes.attachment_link.title
Simple Wi-FI based IoT on BBC micro:bit with XinaBox

# data[].attributes.attachment_link.description
Since its conception the BBC micro:bit has flirted with Wi-Fi - some of the early concepts even included Wi-Fi on the board. In the end they went with BlueTooth, which is an amazing feature that has served micro:bit and the community with distinction. But its not Wi-Fi.

# data[].attributes.headline
ressources pour le micro:bit, académie de Poitiers

# data[].attributes.subject
ressources pour le micro:bit, académie de Poitiers

# data[].attributes.attachment_link.readable_text
Cette petite carte a été crée en 2015 par la BBC. Son but était de faciliter l'apprentissage de la programmation chez les écoliers britanniques (11 ou 12 ans). Depuis 2016 c'est la Fondation pour l'Education Micro:bit qui en assure gestion et la promotion et ses actions dépassent largement le territoire du Royaume Uni.

Le Micro:bit est légèrement plus petit qu'un Arduino, mais semble beaucoup plus robuste. Il est clairement destiné à trainer dans les trousses ou les poches avant d'être lancé d'un bout à l'autre de la salle de cours. Son design sympa avec ses 2 boutons en façade (qui ressemblent à des yeux) et sa matrice de LED, invitent les enfants à la découverte de la carte. Mais, il convient également aux débutants de tout âge.

Caractéristiques techniques

Le site officiel le présente comme un " petit ordinateur programmable " mais il s'agit plutôt d'un microcontrôleur (comparable à l'Arduino).

Comme l'Arduino, il est équipé d'un connecteur dédié à l'alimentation électrique ainsi que d'une prise USB (programmation et/ou alimentation). Mais il intègre également un bouton reset, deux boutons poussoir, un accéléromètre, un magnétomètre (boussole), une matrice de 5×5 LED, une connexion Bluetooth. De plus, il peut mesurer le niveau de luminosité ambiante (en utilisant les LED éteintes) et un capteur de température est intégré au microcontrôleur.

Les connecteurs 0, 1, 2, 3V et GND peuvent facilement être reliés à une fiche banane, une pince crocodile ou une vis métallique de type M3. Mais l'accès aux autres ports n'est possible qu'au moyen d'un connecteur spécial.

Micro:bit Extension Board Robotbit

Programmation

De nombreuses solutions existent pour programmer le Micro:bit (blocs, JavaScript, Python, C). Je vous propose donc ici un rapide tour d'horizon mais nous en reparlerons plus en détail dans les prochains articles.

MakeCode

C'est parfait pour un 1er contact. Mettez un enfant d'une dizaine d'année devant l'éditeur (en lui expliquant rapidement son fonctionnement) et très rapidement il s'amusera à créer ses propres programmes...

L'éditeur MakeCode est accessible en ligne sur le site de la fondation et en français (cliquez sur le petit engrenage pour modifier la langue). L'éditeur est très intuitif (l'interface ressemble à Scratch) et contient de nombreux exemples et tutos. De plus, il contient un simulateur qui permet de tester instantanément le code. Le code généré par les blocs est en JavaScript, vous pouvez l'afficher (ou le modifier) en cliquant dans la barre du haut.

Une fois que le programme vous convient, il suffit de cliquer sur le bouton " Télécharger " et de copier le fichier (.hex) obtenu dans le Micro:bit comme s'il s'agissait d'une clé USB (ou et Envoyer vers).

Edublocks

C'est un autre éditeur de code en ligne, sa version " blocs " ressemble un peu à MakeCode (en plus austère). Mais là, le code généré n'est pas JavaScript mais en Python. Edublocks permet donc de se familiariser en douceur avec la structure et les instruction du langage Python. Il suffit de cliquer sur un bouton (en haut à droite) pour passer du mode bloc ou mode texte.

Scratch 3.0

Il est possible de piloter le Micro:bit (en Bluetooth 4.0) avec Scratch (et Scratch Link). Le principe est différent de MakeCode. En effet, le Micro:bit n'est pas autonome, il est télécommandé en Bluetooth par l'ordinateur et il exécute au fur et à mesure les instructions qu'il reçoit. Cela permet, par exemple de piloter un robot mais aussi d'interagir avec le lutin. La procédure ainsi que des exemples de de code sont disponibles sur le site de Scratch.

mBlock 5 (makeblock)

mBlock est une adaptation de scratch créée au départ par la société chinoise Makeblock pour utiliser les robots pédagogiques mbot. Mais il peut aussi piloter un Arduino et/ou un Microbit. Il permet de travailler en local, sans connexion internet et d'envoyer (uploader ou téléverser) directement le code vers le Micro:bit avec le bouton " Télécharger" . Le logiciel est disponible ici.

MicroBlocks

C'est un langage de programmation par block (inspiré de Scratch). Il faut l'installer sur l'ordinateur mais ensuite il ne nécessite pas de connexion internet. Il permet aussi d'uploader (téléverser) directement le code vers le Micro:bit. Actuellement, il est encore en version alpha, ce qui explique pourquoi il n'est que partiellement traduit (l'interface est en anglais mais les blocs en français). Cela dit il est déjà fonctionnel. Vous pouvez le télécharger ici.

Workbench

Il s'agit d'un autre éditeur de blocs en ligne, que vous pouvez tester ici.

L'éditeur MicroPython

Accessible en ligne sur le site de la fondation, il s'adresse aux utilisateurs plus avancés que MakeCode. Mais le principe reste le même. Une fois le programme tapé, vous téléchargez le fichier hex qu'il suffit ensuite de copier dans le Micro:bit. La documentation (en anglais) est disponible ici.

Mu

Un autre éditeur de code Python mais cette fois ci, en local. Évidemment, le programme doit être installé au préalable sur l'ordinateur. Mais ensuite, il ne nécessite pas de connexion internet. De plus, il dispose de fonctions très pratiques, comme l'aide automatique ou le bouton " Flasher " qui uploade (téléverse) directement le code vers le Micro:bit. Vous pouvez le télécharger ici.

L'IDE Arduino

Il est aussi possible d'utiliser l'IDE Arduino pour programmer le Micro:bit. Cela permet (aux habitués) d'adapter facilement d'anciens programmes Arduino au lieu de les traduire dans un autre langage. La procédure est expliquée (en anglais) sur le site d'Adafruit.

ARMmbed

C'est un IDE en ligne permettant le développement en C/C++.

Applications Android, iOS et Windows 10

D'après le site de la fondation, il serait également possible de programmer le Micro:bit en Bluetooth depuis un smartphone ou une tablette mais je n'ai pas pu tester cette possibilité car je ne possède pas d'Iphone (ou de tablette Windows 10) et l'application Android officielle ne semble pas disponible (à l'heure où j'écris ces lignes). Cependant des applications non officielles existent, mais je n'ai (pour l'instant) pas poussé plus loin mes investigations.

# data[].attributes.attachment_link.description
Cette petite carte a été crée en 2015 par la BBC. Son but était de faciliter l'apprentissage de la programmation chez les écoliers britanniques (11 ou 12 ans). Depuis 2016 c'est la Fondation pour l'Education Micro:bit qui en assure gestion et la promotion et ses actions dépassent largement le territoire du Royaume Uni.

# data[].attributes.headline
Plein de fichiers 3D STL pour les micro:bits

# data[].attributes.subject
Plein de fichiers 3D STL pour les micro:bits

# data[].attributes.attachment_link.description
Thingiverse is a universe of things. Download our files and build them with your lasercutter, 3D printer, or CNC.

# data[].attributes.headline
fichier 3D STL pour ranger 10 micro:bits

# data[].attributes.subject
fichier 3D STL pour ranger 10 micro:bits

# data[].attributes.attachment_link.description
Tinkered from the file: https://www.thingiverse.com/thing:2828041 Easy classroom Micro:Bit storage! This thing was made with Tinkercad. Edit it online https://www.tinkercad.com/things/8fnPe5A3YXp

# data[].attributes.attachment_link.readable_text
Meirion Owen of Milford Haven School sent in these great pictures of Student microbit projects. The AS Product Design Students have come up with some great practical examples of what can be done with a microbit and some ingenuity.

Motion Sensing Ball:

The motion sensing Ball was printed with glow in the dark PLA, which could lead to some interesting STEM experiments. You could play catch at night and during the day and capture the data for analysis.

ZIP LED Lamp microbit Projects:

The lamps make use of ZIP LED Circles that can be coded to produce standard lighting or even a multicoloured show. Also, the onboard light sensors of the microbit can even handle automatic switching.

# data[].attributes.attachment_link.title
microbit Projects From Milford Haven School

# data[].attributes.attachment_link.description
Meirion Owen of Milford Haven School sent in these great pictures of Student microbit projects. The AS Product Design Students have come up with some great practical examples of what can be done with a microbit and some ingenuity. The motion sensing Ball was printed with glow in the dark PLA, which could lead to some interesting STEM experiments.

# data[].attributes.body
Danse des abeilles avec Birdbrain et micro:bit

# data[].attributes.attachment_link.title
Your First Hour of Robotics - BirdBrain Technologies

# data[].attributes.attachment_link.description
Step-by-step lesson plan to introduce students to building and programming with the Hummingbird Robotics Kit.

# data[].attributes.attachment_link.readable_text
Les Pounder

Use micro:bit to water your plants!

What will you need for this project?

Any computer with an Internet connection

A micro:bit

A speaker with 3.5mm headphone jack

5 x Crocodile clips

3 x Female to Male Jumper Wires (Du Pont connectors)

A Soil Moisture Sensor

A USB power bank or micro:bit AAA battery pack.

A plant

All of the code for this project as well as circuit diagrams can be found at
https://github.com/lesp/microbit-plant-protector/archive/master.zip

You can also try out the code in the editor.

Introduction

Continuing from our previous issue, we continue our look at the micro:bit. In this issue we shall create a plant protector. A device that will measure the moisture of our soil and alert us when it drops below a certain level. To do this we shall use a sensor to constantly monitor the conductivity of the soil. Wet soil is a good conductor of electricity and will mean that our plant is happy. Dry soil is a poor conductor and our plant protector invention will alert us to this.

Remember that water and electricity don't mix. NEVER submerge your micro:bit, sensor of battery pack in water as this will lead to damage. Also do not water the plant while the plant protector is in the soil.

By completing this project you will learn more about
Loops
To repeat portions of code
Input
Measuring conductivity of soil based on its moisture.
Outputs

Using the screen to visually indicate the state of the soil.

Using a "heartbeat" to alert the user that the plant requires water.

Conductivity
Learn how water affects the conductivity of soil.

Building the Circuit

Our Soil Moisture Sensor can be found on various online auction sites and via sellers such as Adafruit. The sensor receives 3V and GND from the micro:bit, effectively providing the sensor with power. This is then passed from one tip of the sensor, through the soil, to a receiving tip, which then sends the voltage as an output to our micro:bit. This is then read on Pin 1 and converted to a value of 0 to 1023, where 0 means that the plant has no water, and 1023 the plant is saturated with water. Please refer to the circuit diagram and the photo which shows how the wires are connected.

Our headphones require two croc clips. Our black croc clip connects to the base of the headphone jack, and then it connects to GND on the micro:bit. Out white croc clip connects to the tip of the headphone jack and then to Pin0 of our micro:bit.

Getting Started PXT

To code our project we shall open a web browser and visit https://pxt.microbit.org and we start with a blank project.

The micro:bit pxt blocks interface looks and feels like the Scratch editor

pxt 101

The pxt editor is block based, meaning that we click on the block menu, just left center of the screen. To open a menu, click on it and you will see the blocks that it contains. This will show an expanded window that will briefly lie over the coding area, to the right of the screen. Blocks can be moved from the menu to the coding area and connected in the same manner as with Scratch.

On the left of the screen we have an interactive micro:bit simulator that enables us to test our code before we deploy it to the real hardware. Very handy!

The Block Menu

Here we can see the Basic menu expanded, showing all of the blocks in that menu

PXT Project

We start the code for this project by first clearing the "on start" block from the coding area, drag the block to the menu and drop it to tidy it away. We shall write our code inside the "forever" loop and our first task is to create a Variable. So go to Variables and click on "Make a Variable". Call the variable "soil" and then drag the block "set soil to 0" and place it inside the loop. If you can't see this block, it might be called "set item to 0", use that block and click on the dropdown arrow to change the variable to "soil". Now we need to store some data inside the "soil" variable. In this case the variable is used to store the conductivity of our soil, this is a value from 0 to 1023, which represent the voltage conducted via the soil.

Our sensor is connected to Pin 1 of the micro:bit, so to access the pin click on "Advanced" and then find the "Pins" menu. From there drag the "analog read pin P0" and place it over the zero of "set soil to 0". Now change the pin to P1, this means that the value being read by the sensor will be stored in our variable, "soil".

In order to check the value given by the sensor against what we consider to be "fairly dry" and "very dry" we need to use a conditional test call "if". Go to the "Logic" menu and drag the "if true, then" block and place it inside the "Forever loop" and underneath our previous code. Now you can see a blue "cog" in the top left of this block. Click on it and you will see if, else if and else blocks. Assemble them so that we have from top to bottom, "if", "else if" and "else". To close the pop up click on the cog.

We now need to use an " __ and __" block from "Logic", drag and place this over the "true" of our conditional test. In the first blank space of "__ and __" we shall go back to "Logic" and drag a "0 < 0" block and place it in the blank. This block tests to see if the value in the first blank is less than the value in the second blank. Our first value will be the data stored in our "soil" variable, so go ahead and get that block and place it in the first blank. In the second blank we need to set a limit, in this case we typed the value "500" as this is roughly half the value of conductivity, meaning our soil may be a little dry. Now grab another "0 < 0" block and place that in the other blank space or our "and" block. Again the first value is our "soil" variable, but remember to change the < to a > symbol as we need to check that the soil moisture, and its conductivity is between 200 and 500 for this condition to be evaluated as True. In the last blank space type "200" to set the lower limit.

If the soil moisture reports to be between 200 and 500 then the "if" condition is "True" and the code inside the condition is activated. In this case we need to show the user that the plant is unhappy, we use the "show icon" block from "Basic" and set it to "sad" We also go to the "Music" menu and drag "play tone Middle C for 1 beat" so that it connects under the previous block. This will play a slow "heartbeat" indicating the plant requires water.

For the "else if" condition we shall once again use the "0 < 0" block from the "Logic" menu, but this time we only compare the value inside our "soil" variable with < 200, this means that the plant is in dire need of water. If this condition is True, then we use another "show icon" block from "Basic" and set it to "angry" and we also use a "play tone Middle C for 1 beat" block from "Music" but we change the tempo to "½ beat" to quicken the heartbeat.

For the final "else" condition we do not need to set any values to compare against. Else is used in case all of the previous conditions are False. If all are False, then Else MUST be True. In this case we use it to show that the plant is healthy and well watered. We use the "show icon" block from Basic, and give the plant a happy face. With this final block we now have all of the code for this project. So now click on Download and then connect your micro:bit to your computer. Copy the file from your Downloads folder to the micro:bit and this will cause it to reboot and then run the code.

You can now disconnect the micro:bit from your computer and power it using a USB power bank or the official micro:bit AAA battery pack. Place the sensor into the soil and listen to the health of your plant!

Congratulations you have completed! During these projects we learnt that

Soil when wet is a good conductor of electricity.

We can connect sensors to the micro:bit and measure the environment around us.

Creating an invention does not require lots of code or expensive equipment.

Plants need lots of water to grow.

How could we take this further?

from microbit import *
import music
while True:
    soil = pin1.read_analog()
    if soil < 500 and soil > 200:
        display.show(Image.SAD)
        music.play("C4:1")
        sleep(500)
    elif soil < 200:
        display.show(Image.ANGRY)
        music.play("C4:4")
        sleep(500)
    else:
        display.whos(Image.HAPPY)

Dare you take on the challenge that is Python? In the download for this project we have included the code to recreate the plant protector project using Micro Python. To use this code with your micro:bit you will need to go to http://python.microbit.org/ and write the code. Then plug in your micro:bit and click on Download to download the code, copy the file to your micro:bit and it will reboot and run the plant protector code. There is no need to change the wiring of the project.

Learn More

This Project on Github
https://github.com/lesp/microbit-plant-protector/archive/master.zip
micro:bit Python
http://python.microbit.org/
Micro:bit Foundation Official Website
http://microbit.org/

About the Author

# data[].attributes.attachment_link.description
What will you need for this project? Any computer with an Internet connection A micro:bit A speaker with 3.5mm headphone jack 5 x Crocodile clips 3 x Female to Male Jumper Wires (Du Pont connectors) A Soil Moisture Sensor A USB power bank or micro:bit AAA battery pack.

# data[].attributes.attachment_link.readable_text
IQRemix on Flickr
The craft world and the tech world collide in this fun, hands-on activity.

FOR THIS PROJECT YOU WILL NEED

A micro:bit

5 Crocodile clips

Buzzer

LED

Copper slug tape

5 Bulldog clips (bare, no plastic or paint)

2 x Brass paper fasteners

A4 card

INTRO

In this issue we shall merge the craft world with the computer! We shall create our own computer circuit that uses the micro:bit as a power source and to process the input of our user and perform a corresponding output. And all of this is handled using common stationery items that will cost less than $10 to purchase.

In this project we will learn about

Loops, and how we can have loops running in parallel.

Conditional test and how they can be used to change the flow of our code.

Inputs and outputs, and how the computer will understand what to do.

So let's get started!

HARDWARE

The main part of this project is the circuit, and for this we need a piece of A4 card, folded in half lengthways so that we have a firm base. Use glue to ensure that the card stays folded. If you are using cardboard then you can skip this bit.

The first strip of tape for our circuit is the GND connection. Measure a length of tape to go the full length of the card plus 20mm so that we can secure the tape to the card by wrapping it over. To apply the tape smoothly use a cylindrical object to roll the tape down as it is moved along the card. We used an old AA battery for this. Using a permanent marker write "GND" on the tape to identify that it is for our GND connection. Repeat this process at the top of the card for the 3V connection.

For the next connection, 0, we shall use another full length of copper tape just underneath our 3V strip. Ensure that they do not touch! Mark this strip as 0, as it will connect to our micro:bit's 0 GPIO pin.

For our next strip, 1 we shall position it underneath 0, not too close! But this time it will only be 2/3 of the length of the card. Why? Well to ensure that we can create a clean circuit later! Mark this strip 1.

For the final strip, 2, we need this to be under 1, and be only ? of the length of our card. Mark this as 2.

With all the tape applied we next clip our bulldog clips to the left edge of the tape, but why do we do this? When we later connect the crocodile clips their "teeth" will damage the tape rather quickly. Our bulldog clips give us a secure and tough connection.

Let's make our first connection, between 2 and GND. This will be a momentary switch, a push button. For this we shall use a brass paper fastener. So using a pen or screwdriver carefully make a hole between the two strips. Then insert the paper fastener through the back of the card and split the legs of the fastener so that one is touching the GND strip, the other touching 2.

Now using a little more copper tape secure the leg to GND, but leave the leg hanging over 2 so that when it is pressed it will make a momentary connection before springing back.

The next connection is between strip 1 and GND. For this we shall use an LED, a Light Emitting Diode. Our LED has two legs, the long leg called the Anode will connect to strip 1, using a little copper tape to hold the leg down. Then add a little copper tape underneath the shorter leg, called the Cathode. This shorter leg will connect to GND using another brass paper fastener inserted from the rear of the card. The legs of the paper fastener will connect the short leg of the LED to GND. Again use a little copper tape to hold it down. As an LED is a diode, a component that only allows current to flow in one direction, we need to make sure that connection is the right "polarity" so that the flow of current is not stopped.

Our final connection will connect our buzzer. The buzzer has two wires, a red wire, which will connect to strip 0, and a black wire which connects to GND. If needed, strip the wires so that there is a good connection. Use a little copper tape to secure them down.

With the circuit complete, we now need to connect the circuit to our micro:bit. Connect each of the strips to the micro:bit using crocodile clips from the micro:bit to the bulldog clips of the circuit. Ensure that you connect the numbered strip to the same numbered GPIO pin (it really is a hole) on the micro:bit.

With the connections made, we can now start writing code. Connect your micro:bit to a computer, and in a web browser visit microbit.org.

SOFTWARE

For this project we shall use the MakeCode editor. We can find this from the main microbit.org website by clicking on "Let's Code" at the top of the screen. Then on the next screen click on the Javascript block editor.

In a few moments we will see the Make Code editor and just a quick refresher on the interface.

On the left we have a virtual micro:bit which we can use to simulate and test our code.
In the centre we have the palette of blocks that we can use to write code.
On the right we have the building area, where code is created using the blocks.

You will see that there are two blocks already in the coding area. "On start" is used once and runs when the micro:bit is powered up. "Forever" as you can guess, will continually run any code within it.

We shall start by adding code to "On start" and for this we need to click on "Advanced" and go to the "Pins" blocks. In there look for "...more" and click on it. Then scroll down to "set pull pin p0 to up." Drag this block and drop it inside "on start" then change "P0" to P2 as this is where our push button is connected.

But why have we done this? Well We have set P2 so that the pin is turned on and has power. When the brass paper fastener button is pressed, it will connect P2 to GND, causing the pin to go from HIGH (on) to LOW (off) and triggering our code to run.

Making the buzzer sound

For our first forever loop we shall go to the "Logic" blocks and use the "if true then..else" block.

Drag this into the forever loop as so. But this comparison test is not ready, we need a way to check one value against another, and for that we go back into the "Logic" blocks and use the "0 = 0" block.

Drag this and place it over "true".

But there is still one step before we can move on, we need to replace the left 0 with a block that will read the state of our button, connected to pin 2 of the micro:bit via our copper tape circuit. We can find this block in the "Pins" section, and it is called "digital read pin P0"
Place this over the left 0 of the previous block and then change the P0 to P2 using the blocks drop down menu.

We can leave the second 0 as 0. Because we shall be checking to see when the pin is turned off. (Hint: It will turn off when we press the brass paper fastener down)

Now at this stage of the project, right click on the forever block and select "Duplicate" and it will copy all of our work so far. Move this duplicated block of code out of the way for now.

Back to our original loop and we now need to use two more blocks from "Pins", the first will turn P0, which is connected to our buzzer on for as long as our finger is pressing the button! But when the button is not pressed, it will turn off the buzzer.

The blocks fit as so.

That is the first section of code completed!

Making the LED flash

For the second forever loop we start with the comparison that tests to see if the button has been pressed. But this time we would like the LED to flash four times when we press the button. For this we need to use the "repeat 4 times" block found in the "Loops" section. Drag this into the "if" part of the code.

But what do we want to happen four times? Well we first want the LED connected to P1 (1 on our circuit board) to turn on, and we use the "digital write pin" block found in the "Pins" section to do that. Then from "Basic" we use the "pause (ms) 100" to stop the LED turning off too quickly. Then we use another digital write block to turn the LED off, and another pause block to stop the code running too fast.

The final step in our code is to create the code that will run in the "else" condition, which means when the button is not pressed this code will run. In this situation we just need P1 to turn off. Again we use the digital write block from the "Pins" section.

So now we should have three blocks of code that look like this.

Download the code

With all of the code complete, we now need to save our work, at the bottom of the screen is a disk icon (kids ask your parents!) and the word "Untitled" change this to Cardboard-Electronics and click on the disk to save. It will also download a copy of the code to our Downloads folder.

Plug in your micro:bit to the computer and it will appear as a USB flash drive.

Now using the file manager of your operating system, copy the downloaded file to the MICROBIT drive. Once the file is copied over, the drive will disappear from the file manager, and the micro:bit will begin "flashing", which means that our code will be written to the micro:bit. Once it is complete the micro:bit drive will reappear in the file manager, and we can now press the brass Paper fastener button to trigger the code to run!

Well done, you have created your first cardboard computer circuit.

So what have we learnt?

How to build circuits using stationery

How to connect a micro:bit to a home made circuit

How to write code using MakeCode blocks

Learn More

WikiHow: Making a Simple Electrical Circuit
https://www.wikihow.com/Make-a-Simple-Electrical-Circuit
Electrical Circuit Projects for Elementary Students

https://learning-center.homesciencetools.com/article/circuit-science-projects-for-elementary/
https://www.shareitscience.com/2017/09/DIY-paper-circuit-board-games-STEM.html

An Electrical Circuit Quiz Board
https://www.teachingtreasures.com.au/K-10Projects/quizboard/quizboard.htm

About the Author

# data[].attributes.attachment_link.description
FOR THIS PROJECT YOU WILL NEED A micro:bit 5 Crocodile clips Buzzer LED Copper slug tape 5 Bulldog clips (bare, no plastic or paint) 2 x Brass paper fasteners A4 card INTRO In this issue we shall merge the craft world with the computer! We shall create our own computer circuit that uses the micro:bit ...

# data[].attributes.attachment_link.readable_text
This board, designed for use with the Lets Talk Science Living Space Project, provides a CO2, temperature and Relative Humidity measurements to a BBC micro:bit.

Getting Started

Wire-up the board to your micro:bit as shown above. Then flash the following program onto your micro:bit by clicking the image to open the blocks editor and then click on Download (bottom of the web page) and copy the hex file onto your micro:bit.

Once the program is uploaded, pressing Button A will display the CO2 level in parts per million of CO2. Pressing button B will display the temperature in degrees C and both buttons together will show the relative humidity.

If you are wondering about the big gray serial redirect block in the on start block, well this block starts serial transfer of data between the micro:bit and the CO2 sensor.

MicroPython

You can also use the board with MicroPython as the following code example shows.

Unless you are interested in the serial protocol used, you may want to copy the code below into your program and make use of the functions get_co2(), get_tempC() and get_rh().

from microbit import *

uart.init(tx=pin0, rx=pin1)

co2 = 0
tempC = 0
rh = 0

def check_incoming_messages():
global co2, tempC, rh
if uart.any():
response = str(uart.read(), 'UTF-8')
if len(response) < 8:
return
cmd_letter = response[1]
cmd_value_str = response[2:8]
value = int(cmd_value_str)
if cmd_letter == 'Z':
co2 = value
elif cmd_letter == 'T':
tempC = (value - 1000) / 10.0
elif cmd_letter == 'H':
rh = value / 10

def get_co2():
uart.write('Z\r\n')
sleep(100)
check_incoming_messages()
return co2

def get_tempC():
uart.write('T\r\n')
sleep(100)
check_incoming_messages()
return tempC

def get_rh():
uart.write('H\r\n')
sleep(100)
check_incoming_messages()
return rh

# Copy the code above into your program and then use the functions
# get_co2, get_tempC and get_rh in your own code

while True:
display.scroll(get_co2())
if button_a.was_pressed():
display.scroll('T=' + str(get_tempC()))
if button_b.was_pressed():
display.scroll('RH=' + str(get_rh()))
sleep(500)

CO2 Concentrations

So, what do these readings mean?

Fresh outdoor air should give a reading of around 400. In a smallish room with a few people in it, this will rapidly rise above 1000, as people breathe out CO2. If it gets above 2000 then your air is getting dangerously unhealthy.

Calibration

Your sensor is a sensitive scientific instrument and the readings it gives will gradually get less accurate. If you leave the sensor powered-up in a well ventilated room for 24 hours, then it will calibrate itself automatically.

You can also force calibration using the Calibrate CO2 block in the COZIR blocks category. This will set the sensor's readings back to 400. So you should run this block only after the sensor has been in fresh air for 30 mins or so.

Altitude Compensation

If you live somewhere high up, then you need to tell the sensor about this by putting a Set Altitude block into your On Startup block and then changing its number to your altitude above sea-level in meters.

Battery Power

Once you have the code all working, you can disconnect the USB power and instead power the CO2 Sensor Board through the DC barrel jack using either a battery pack or a DC adapter. In both cases the power supply should be of between 5 and 9V.

When powered by batteries in this way, the CO2 sensor will provide power back to the micro:bit. But make sure you have the power leads connected right between the CO2 sensor board and the micro:bit or your micro:bit could be damaged.

# data[].attributes.attachment_link.description
This board, designed for use with the Lets Talk Science Living Space Project, provides a CO2, temperature and Relative Humidity measurements to a BBC micro:bit. Wire-up the board to your micro:bit as shown above.

# data[].attributes.headline
Comment sauvegarder des données des capteurs du micro:bit

# data[].attributes.subject
Comment sauvegarder des données des capteurs du micro:bit

# data[].attributes.attachment_link.readable_text
The BBC micro:bit contains various sensors for measuring temperature, light intensity, direction, movement, and so on. These sensors might be valuable in a project in which measurement data collected by one micro:bit (the sensor) can be communicated to another micro:bit (the receiver) and displayed on the LEDs. However, there are methods by which this sensor data can be collected and saved in a data file.

The micro:bit does not have the capability to open and write directly to a file but it does have the capability to write to your computer's serial port (via the USB connection - remember - USB stands for Universal Serial Bus). A terminal emulation program can be used to display the data in real time. Additionally, that data can be easily saved to a text file.

This post describes this process with an example project that I coded and tested on a Mac running macOS High Sierra (ver 10.13.6) and on a Chromebook running ChromeOS (ver 71.0.3578.127).

Click to jump to a section:

1. Programming the sensor micro:bit

2. Programming the receiver micro:bit

3. Capturing the serial data on your computer...

4. ...Using macOS

5. ...Using a Chromebook

Programming the sensor micro:bit

This code simply sends data through the radio so that another micro:bit can receive the data. The sensor will measure and transmit six readings: temperature, light level, compass heading, acceleration strength, rotation pitch, and rotation roll. You can access this code here: https://makecode.microbit.org/_4ds5jqKbWAWA This project sends sensor data to the receiver about once per second via the radio; depending on your experiment, you might need to adjust the "pause (ms)" blocks to collect sensor readings more or less frequently.

Because the "radio send string" block has a limit of 19 characters, I have coded the sensor information to be sent in two separate strings. In order to keep the data organized, the letter "A" or the letter "B" is the first character of the string transmitted by the radio. This will become the method by which the receiver micro:bit can correctly identify what information it is receiving.

Note that the "join" code within the "radio send string" in the code below could easily be modified to create comma separated values (CSV) so that the output from the receiver micro:bit could be quickly imported into a spreadsheet and analyzed / graphed.

Programming the receiver micro:bit

This code takes action when it receives data via the radio. The variable CheckTag looks at the first character in the string received and takes one of three actions as indicated in the code below. If CheckTag is A, then Data1 will be assigned the first set of three sensor readings (see code above). If CheckTag is B, then Data2 will be assigned the second set of three sensor readings (see code above). If CheckTag is C, then Data1 and Data2 will be joined and sent to the serial port. Some extra code was included (button A press) so that a new header could be sent to the serial port in case the data is being view in real time and needs to be identified. Access to this code is available here: https://makecode.microbit.org/_AP7LLd4wU1U3

(Note: There is a bug involving the "substring of" text function block. The built-in help reference for substr says that if you wish to create a substring of a given string starting at a specific position, and including the rest of the string, whatever the length, it says you can leave the "of length" value to nothing. This cannot be done using the blocks. When switching to the javascript interface and removing the second value (length), the value 0 is always automatically inserted. It is for this reason that I used a value "20" as length in those blocks below. This caused me much frustration during testing until it occured to me that there might be a bug in the block.)

Capturing the serial data on your computer...

How does this project work using the serial port? The "serial write line" block (or any of the other serial write blocks) sends text data to the serial port via the USB connector on your micro:bit. Your computer can read this incoming data by using a terminal program. These kinds of applications have been around for decades and were commonly used in communication between two computers on a network starting in the 1970s. Perhaps the most common terminal was DEC VT100 (pictured). Today, there are apps you can download to your computer that "emulate" these terminals. In the past, they were actual devices that looked much like an old style desktop computer but they could not perform actual computing tasks on their own (sometimes they were called dumb terminals).

...Using macOS

For this project, I used used a free macOS application called SerialTools as my terminal instead of using a built-in terminal emulator. The serial reference information on the makecode site suggests opening the built-in Terminal program on a Mac (or analogous one on a PC or in Linux) and then using a command like: sudo screen /dev/cu.usbmodem1422 115200. There are command line suggestions for Linux and Windows 10 as well... but I found that using a terminal emulator app, like SerialTools, worked better.

Once both of your micro:bits have been flashed with the HEX files, and both are running, make sure the receiver micro:bit is plugged into your computer via the USB connector.

Then, in my case, I started SerialTools on my Mac. Look for something like "usbmodem1422" in the serial port list (the '1422' might be a different number on your computer):

Then, click on the "Connect" button to start displaying the data coming into the serial port from the micro:bit:

To observe how the sensor data changes in real time, pick up the sensor micro:bit and move it around; bring it close to a bright light source, or place your thumb onto the CPU chip to see the temperature rise.

Once you have the data you want, highlight that data in the terminal window and right click to copy. Then, open TextEditor on a Mac and paste in the values:

As I noted above, I separated the sensor values in this project with a space character for but you can easily change that to a comma in the sensor code so that you could produce a CSV file of the sensor data. CSV files are easily imported into your favourite spreadsheet for further analysis or graphing.

...Using a Chromebook

Similar to adding the SerialTools app on macOS above, on your Chromebook you also need to add an app. Head over to the Chrome Web Store and look for Beagle Term (there are other ChromeOS terminal emulators but I used this one successfully). Once the app has been added to Chrome, make sure both of your micro:bits have been flashed with the HEX files, and both are running. Make sure the receiver micro:bit is plugged into your computer via the USB connector.

Now, start up Beagle Term. You will be asked to configure but just go with the defaults:

(Note: if you do not see a device listed beside "port" then the microbit either isn't plugged in or the Chromebook has not detected it yet. Notice also that on the Chromebooks, my micro:bit connection to the serial port is identified as /dev/ttyACM0 which is very different to the device name my macOS gave: usbmodem1422 - just interesting to note.)

Now, click on "Connect."

Once connected, the app will display the data being sent by the serial write line blocks from the receiving micro:bit. Once all of the measurements have been collected, you will need to copy and paste all of the data from the terminal window to a Google Doc or Sheet:

1. Double click at the start of the text that you want to select in the Terminal window.

2. Scroll the window to the end of the text you want select.

3. Shift + click the end of your selection.

4. All text between your first click and your last Shift + click is now selected.

5. Ctrl + C to copy your selection.

6. Open the Docs file where you wish to paste the data.

7. Click Ctrl + V to paste your selection.

As noted above, I separated the sensor values in this project with a space character for but you can easily change that to a comma in the sensor code so that you can ultimately produce a CSV file of the sensor data. CSV files are easily imported into your favourite spreadsheet for further analysis or graphing.

Let me know in the comments below how you have captured data from the micro:bit in your projects!

# data[].attributes.attachment_link.description
The BBC micro:bit contains various sensors for measuring temperature, light intensity, direction, movement, and so on. These sensors might be valuable in a project in which measurement data collected by one micro:bit (the sensor) can be communicated to another micro:bit (the receiver) and displayed on the LEDs.

# data[].attributes.headline
Lire la température d'un micro:bit avec une appli android

# data[].attributes.subject
Lire la température d'un micro:bit avec une appli android

# data[].attributes.attachment_link.readable_text
The Micro Bit also referred to as BBC Micro Bit, stylised as micro:bit is an ARM-based embedded system designed by the BBC for use in computer education.

The BBC micro:bit is a pocket-sized computer that lets you get creative with digital technology. Each order contains just the micro:bit board. You can code, customize and control your micro:bit from anywhere! You can use your micro:bit for all sorts of unique creations, from robots to musical instruments and more. At half the size of a credit card, you will be surprised at the amount of hardware each board is equipped with, including 25 red LED lights that can flash messages. There are two programmable buttons that can be used to control games or pause and skip songs on a playlist. The micro:bit can even detect motion and tell you which direction you're heading. It can also use Bluetooth Low Energy (BLE) to interact with other devices and the Internet.

Taking a closer look at the front of the board, we can see the 5×5 LED array that you can use as a light sensor, a tiny screen to draw on, display words, numbers and other information, and the two programmable buttons! On the back of the board you will find the brains of the micro:bit, a 16MHz, 32-bit ARM Cortex-M0 microcontroller with 256KB Flash, 16KB RAM and a built-in temperature sensor. Additionally, the back of the micro:bit is populated by an accelerometer, compass and Bluetooth Smart antenna, as well as a microUSB and two-pin JST connector for different power options. Finally, at the bottom of the board you will find 20 gold-tabbed edge pins and five ring connectors (three for digital/analog I/O, two for power and ground) for hooking up external components. The tabs with larger holes can be easily used with alligator clips to prototype added components quickly.

Micro:bit has even supplied an intuitive mobile app that lets you send your code to your micro:bit over Bluetooth (without using a USB cable) and more. With this app you will be able to interact with your micro:bit on a higher level of accessibility.

Important: The micro:bit does not include any cables or power sources. This is just the board. We recommend picking up a micro:bit AA battery holder or a micro USB cable as well to power your board.
Features:

32-bit ARM Cortex-M0 CPU

256KB Flash

16KB RAM

5×5 Red LED Array

Two Programmable Buttons

Onboard Light, Compass, Accelerometer and Temp Sensors

BLE Smart Antenna

Three Digital/Analog Input/Output Rings

Two Power Rings - 3V and GND

20-pin Edge Connector

MicroUSB Connector

JST-PH Battery Connector (Not JST-XH)

Reset Button with Status LED

Objectives
Read temperature remotely on an Android phone with BBC micro:bit and Bluetooth Low Energy BLE. Write the codes, using the simplest ways, for the BBC micro:bit and Android smartphone, and test the setup.
Setup
Duly connected BBC micro:bit through USB connector to PC and use an Android smartphone compatible with Bluetooth Low Energy BLE.
1. Coding the BBC micro:bit
Coding can be of several type offered for BBC micro:bit. You can code your BBC micro:bit using Blocks, JavaScript, Python, and mbed platform. We will use Blocks offered at http://microbit.org/code/ to install the firmware in simplest way. Blocks provide a visual programming, drag-and-drop tool involving building application logic by arranging graphical programming blocks representing predefined, parameterised functions. And it's very easy to use.

To use Bluetooth in your micro:bit application you first need to add the Bluetooth package to your project using the menu More/Add Package.

Once this is done (you may receive a warning of some incompatibilities, but do accept them) , you will have a complete collection of Bluetooth related Blocks with which can build the Bluetooth capabilities of your application. Many are very simple and merely result in a given Bluetooth service being available at run-time. But there are also blocks which provide access to Bluetooth connect and disconnect events and the Bluetooth UART service can be used to transmit arbitrary data to a connected peer or to receive data from a peer service.

The following image shows all the the blocks that will become available

Now you are ready to write the code. Let's code! Drag and drop the blocks to get the following result:

Save the code giving it a name. And download the respective .hex file. At this stage you should connect the BBC micro:bit to your PC (in my case with Windows 7 OS).

Yo are now ready to install the firmware in BBC micro:bit which behaves like a drive in your PC and will be visible. You will need to copy, or drag and drop, the hex file into BBC micro:bit:

The hex file once dropped or pasted ("Colar" in above image means "Paste") will install itself in BBC micro:bit, and run.
2. Writing an App for Android
To stay in visual programming we will write now an App for Android smartphones. MIT has MIT App Inventor (now version 2) that we will use to write the App.

MIT App Inventor is an open-source web application originally provided by Google, and now maintained by the Massachusetts Institute of Technology (MIT).

It allows newcomers to computer programming to create software applications for the Android operating system (OS). It uses a graphical interface, very similar to Scratch and the StarLogo TNG user interface, which allows users to drag-and-drop visual objects to create an application that can run on Android devices. In creating App Inventor, Google drew upon significant prior research in educational computing, as well as work done within Google on online development environments.

MIT App Inventor and the projects on which it is based are informed by constructionist learning theories, which emphasizes that programming can be a vehicle for engaging powerful ideas through active learning. As such, it is part of an ongoing movement in computers and education that began with the work of Seymour Papert and the MIT Logo Group in the 1960s and has also manifested itself with Mitchel Resnick's work on Lego Mindstorms and StarLogo.

MIT App Inventor is also supported with the Firebase Database extension. This allows people to store data on Google's firebase.

a) Register yourself at http://ai2.appinventor.mit.edu/ using a Google or other accepted email account. We will first add Bluetooth Lowe Energy blocks to MIT App Inventor-

b) First and foremost we need now to add the necessary extension. In the Palette windows click on Atension at the bootm and then on "Import extesnion" and click on "URL". Paste the URL:
http://iot.appinventor.mit.edu/assets/com.bbc.microbit.profile.aix
c) We will not show all the steps you need to undertake nor of how to build the blocks blocks. I suggest you follow the tutorial by downloading and reading and following the tutorial at: http://iot.appinventor.mit.edu/assets/howtos/MIT_App_Inventor_Microbit_Temperature.pdf

If you are too lazy to write the App cyou can download the code here. The file named BLE_Temp_Mon.aia is made available at github.com repository that you can import into your MIT App Inventor account. You will, once imported, have to compile and export the application with .apk extension into your Android phone and isntall. You will find plenty of information in Internet on how to do it.

If you have difficulties for any parts of this tutorial do not hesitate to contact me.
3) Pairing Android phone with BBC micro:bit
Making your BBC micro:bit pair requires you to follow some simple steps which will be described shortly. What you do with the device you're pairing it to will vary slightly depending on what that device is. We'll look at how it's done with common smartphones and tablets here too.

To get your micro:bit ready for pairing do the following:

1. Hold down buttons A and B on the front of your micro:bit together. The front is the side with two buttons and the LED display. Keep the two buttons held down. Don't let go of them yet!

2. While still holding down buttons A and B, press and then release the reset button on the back of the micro:bit. Keep holding down buttons A and B.

3. You should see "PAIRING MODE!" start to scroll across the micro:bit display. When you see this message start to appear you can release buttons A and B.

4. Eventually you'll see a strange pattern on your micro:bit display. This is like your micro:bit's signature. Other people's micro:bits will probably display a different pattern.

Your micro:bit is now ready to be paired with the other device.
4) Testing the App on Android phone
If you have installed the apk compiled from the .aia file that I have provided you will see the following icon in your Android phone:

Click on icon to start the App. Click on Scan button:

You will see the paired BLE device that is BBC micro:bit. Click on black labelled button containing data on the device that is paired and next click on Connect button:

If all is well you will see the Status as Connected and read the temperature in ºC:

You will see the right sign on the BBC micro::bit:

If Bluetooth is disconnected by pressing Disconnect button or for any other reason, the display will show X which means disconnected!
Conclusions
Of course you can do more thinks like hearing the temperature om the Android phone writing a modification to App, and other things. Also, instead of using the ready made temperature block you can write your own one for the BBC micro:bit. If you do use any parts of my tutorial please acknowledge as I do here.
Acknowledgmenets
A special thank you to y Martin Woolley for inspiring articles and videos on BBC micro:bit, and one of his tutorial already acknowledged above. Also a special thanks to Github for providing their free repository to facilitate sharing. MIT App Inventor and Microbit coding sites also have special right to acknowledgements for their free services.

# data[].attributes.attachment_link.title
Remote Reading of Temperature with BBC micro:bit and Bluetooth Low Energy BLE

# data[].attributes.attachment_link.description
Introduction The Micro Bit also referred to as BBC Micro Bit, stylised as micro:bit is an ARM-based embedded system designed by the BBC for use in computer education. The BBC micro:bit is a pocket-sized computer that lets you get creative with digital technology. Each order contains just the micro:bit board.

# data[].attributes.attachment_link.description
Scratch is a free programming language and online community where you can create your own interactive stories, games, and animations.

# data[].attributes.headline
Micro:bit et Scilab relevé de température

# data[].attributes.subject
Micro:bit et Scilab relevé de température

# data[].attributes.attachment_link.readable_text
The Micro Bit also referred to as BBC Micro Bit, stylised as micro:bit is an ARM-based embedded system designed by the BBC for use in computer education.

In my previous tutorial here in this blog,I showed how to read temperature with a purpose written app in App Inventor for Android phone that connects to BBC micro:bit through Bluetooth Low Energy (BLE). With an edge connector more pins can be accessed facilitating connection to other devices. Despite BBC micro:bit having hardware capable of allowing the device to work as a BLE device, it has disadvantage that only has 16k of RAM. The BLE stack alone takes up 12k RAM which means there is little room to run MicroPython and bigger codes.

Scilab is a free and open-source, cross-platform numerical computational package and a high-level, numerically oriented programming language. It can be used for signal processing, statistical analysis, image enhancement, fluid dynamics simulations, numerical optimization, and modeling, simulation of explicit and implicit dynamical systems and (if the corresponding toolbox is installed) symbolic manipulations.

Scilab is one of the two major open-source alternatives to MATLAB, the other one being GNU Octave. Scilab puts less emphasis on syntactic compatibility with MATLAB than Octave does, but it is similar enough that some authors suggest that it is easy to transfer skills between the two systems.
Objectives
Connect BBC micro:bit to Scilab for reading anf plotting temperature of the processor on micro:bit. Write the codes, using the simplest ways, for the BBC micro:bit and Scilab, and test the setup.
Requirements

BBC micro:bit

Edge-connector for BBC micro:bit: We used micro:bit IO F5 board ( 8x OUTPUT, 6x INPUT) - INPUT signal to 5V) Note that it is not needed in this project, only in next one when we will do control with Scilab.

Mini-USB cable connector for programming and serial connection

Scilab duly installed in your PC

Our Setup
Connect the small end of the cable to your micro:bit and the other end to your computer's USB port.

Windows 10 & 8.1: Windows Update will fetch any necessary drivers. For earlier versions of Windows, (Windows 7, or Vista) if you would like to use serial communication ( not necessary to program your micro:bit) you will also need the Arm MBED serial port driver.

Mac OS and LInux require no driver installs.
1. Coding the BBC micro:bit
Coding can be of several type offered for BBC micro:bit. You can code your BBC micro:bit using Blocks, JavaScript, Python, and mbed platform. We will use Blocks offered at http://microbit.org/code/ to install the firmware in simplest way.

We will use Serial communication with Scilab. Before we can use the micro:bit serial port, we need to install a serial terminal program, and we also need to install the USB serial driver. In this tutorial, we will be using Tera Term. To get the driver, start by following the links below, then follow the installation instructions.

The following image shows the Blocks we are going to chose that is available for USB serial communication found under Advanced blocks;

Now you are ready to write the code. Let's code! We will write the following code with Blocks:

You can review the code under Javascript tab which will be as follows:

serial.redirect(
    SerialPin.USB_TX,
    SerialPin.USB_RX,
    BaudRate.BaudRate9600
)
basic.forever(function(){
    serial.writeString("\n" + "\r" + input.temperature())
    basic.pause(100)
})

Save the code giving it a name. And download the respective .hex file. I have also provided the hex file you can download from here. At this stage you should connect the BBC micro:bit to your PC (in my case with Windows 7 OS).

You are now ready to install the firmware on BBC micro:bit which behaves like a drive in your PC and will be visible. You will need to copy, or drag and drop, the hex file into BBC micro:bit:

The hex file once dropped or pasted ("Colar" in above image means "Paste") will install itself in BBC micro:bit, and run.
2. Testing the set up
We need to verify that the BBC micro:bit is sending the temperature readings through the USB. Im our case we tested with Tera Term that is free and open source and can be installed in one's PC with Windows.

Download the Arm Mbed Windows serial port driver and install it.

We need to know the port name that our PC has given to the BBC micro:bit through USB connection.

To check the BBC micro:bit is seeen by PC As a serial device we open Device Manager and look under Ports (COM and LPT):

In our case here it is COM4. So let us view it on Tera Term. We select Serial and chose our Port (in our case COM4).

Clicking on OK immediately we will see on the Terminal opened by Tera Term the temperature readings:
3) Read temperture and plot with Scilab
The test was carried on Scilab 5.5.1 as besides being stable has many modules. The most recent version of Scilab 6.0.1 presented problems and it is unwise to use it at the moment. We will not explain how to install Scilab 5.5.1.- There are plentiful of tutorialsshowing how to do.

Assuming Scilab is intalled we will ass he Serial communication module by a simple command:

atomsInstall("serial")

You may need to update the database of Scilab, and to install ATOMS library.

To avoid mistakes in script writing to read and plot the temperature, it is availalbe for download.

Once downloaded and opened in Scilab verify the line 62 position 4 and change the name of the port from "= 4" to whatever is port number is BBC micro:bit recognised by your PC:

We are now ready to run the script. Run the script by clicking onto Execute:

The script will open a window as shown with indiaction "Waiting for start":

Clicking onto " Start measuring... " button Scilab will read the temperature and plot it as shown:

The plot shows variation of temperature by blowing air with mouth, over the processor. If we click onto " Stop measuring ", Scilab will stop reading the temperature and the plot will stop.
Conclusions
Clicking again on " Start measuring... " button, Scilab will continue reading the temperture and plotting it.
Acknowledgments
Of course you can do more things with Scilab and BBC micro:bit, as we expect to do in our future post. Scilab is a powerful tool that can be used for signal processing, statistical analysis, image enhancement, fluid dynamics simulations, numerical optimization, and modeling, simulation of explicit and implicit dynamical systems and symbolic manipulations.
DISCLAIMER THE SOFTWARE HERE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
A special thank you to Github for providing their free repository to facilitate sharing. Scilab and Microbit coding sites also have special right to acknowledgements for their free services. Also a special mention is due to Paraschos Paraschos for inspiring me towards this post.

# data[].attributes.attachment_link.title
BBC micro:bit Temperature Measurement with Scilab

# data[].attributes.attachment_link.description
Introduction The Micro Bit also referred to as BBC Micro Bit, stylised as micro:bit is an ARM-based embedded system designed by the BBC for use in computer education. In my previous tutorial here in this blog,I showed how to read temperature with a purpose written app in App Inventor for Android phone that connects to BBC micro:bit through Bluetooth Low Energy (BLE).

# data[].attributes.attachment_link.readable_text
What is Edublocks - EduBlocks is a visual block based programming tool that is designed to help introduce text based programming languages, like Python, to children at an earlier age. With Edublocks, kids can start familiarizing themselves with text based programming language patterns, structure, requirements using a block based approach. Edublocks support development on the following platforms.

1. Python - EduBlocks Pi features a range of Basic Python functions to get you started with how the basics of Python work.

2. GPIOZero - GPIOZero written by Ben Nuttall and Dave Jones is the most common library for controlling the Pi's GPIO pins. You can use it to spin motors, control LEDs and much more!

3. Minecraft - The Raspberry Pi features Minecraft Pi Edition as standard, EduBlocks includes the Python library that allows you to hack Minecraft!

4. SonicPi - Sonic Pi, written by Sam Aaron, allows you to make music with code. The unoffical Python library for Sonic Pi is included in EduBlocks.

5. PiMoroni Addons - Control the BLINKT! LED stip and the Explorer hat with the official libraries included in EduBlocks.

6. BitIO - BitIO, written by David Whale of the micro:bit foundation, allows you to control the micro:bit via Python 3 using serial commands.

Edublocks is opensource and free to use by everyone. You need to install some software to use it on the Raspberry Pi while developing for the micro:bit does not require installation, but only access to a web browser. You can read more about Edublocks here - https://edublocks.org/

Python programming with Edublocks on the BBC micro:bit - As part of today's tutorial we will explore Edublocks and attempt programming our BBC micro:bit board with the Edublocks editor. We will program the BBC micro:bit board to detect a button press and display the button that was pressed on the LED screen. The BBC micro:bit has two buttons on it i.e. button A, button B. Depending on which button has been pressed the LED's will display "Button A" or "Button B". This is our first game in MicroPython with Edublocks and it's quite exciting to be putting this together. We hope you enjoy working with Edublocks, micropython and more so with the BBC micro:bit.

So let's dive into the game below -

What is the BBC micro:bit - The BBC MicroBit (also referred to as BBC micro:bit) is an open source hardware ARM-based embedded system designed by the BBC for use in computer education in the UK. The BBC micro:bit was first announced on the launch of BBC's Make It Digital campaign on 12 March 2015 with the intent of delivering 1 million devices to pupils in the UK. Here's some of what's packed into micro:bit -

1. The micro:bit is half the size of a credit card and has an ARM Cortex-M0 processor

2. The micro:bit comes along with an accelerometer and magnetometer sensors

3. The micro:bit offers Bluetooth and USB connectivity

4. Also embedded into the micro:bit front face is a display consisting of 25 LEDs and two programmable buttons

You can pick up a BBC micro:bit at the the following page - https://www.oztoylib.com.au/product/bbc-microbit/

Access our free courses on Scratch, BBC Micro:Bit, Raspberry Pi, Robotics and Electronics at KidzCanCode.com. You can also check out our online store here - < OzToyLib>.

Hopefully you have enjoyed the tutorials. If you have any questions, comments or suggestions for future tutorials drop us a note at - learning at hack2 dot live.

# data[].attributes.attachment_link.title
Edublocks & MicroPython - Detecting Button Press on the BBC micro:bit

# data[].attributes.attachment_link.description
What is Edublocks - EduBlocks is a visual block based programming tool that is designed to help introduce text based programming languages, like Python, to children at an earlier age. With Edublocks, kids can start familiarizing themselves with text based...

# data[].attributes.attachment_link.readable_text
The code has been written using Microsoft MakeCode in block mode, using the Enviro:Bit extension.
Bellow you find the corresponding JavaScript Code.

The function envirobit.getSoundLevel() reads the sound level from the sensor, returning a value from 0 to 443.

The constant signal_max defines a maximum value of the dynamic range to be displayed on the LED matrix, values above will treated as a being signal_max. This allows you to optimize the sensitivity of the device for your application.

The maximum value detected in a measurement circle are stored in the variant noise_max and remains displayed on the LED matrix.

Pressing button "A" resets noise_max and clears the screen, pressing button "B" displays the measured noise value as actual number.

To display the value, the values below signal_max are placed in 25 "bins" represented by one LED, starting from 0 (upper left) to 24 (lower right). Then the x/y position is calculated and the corresponding LED is switched on. Values above signal_max are placed in bin 24. If the value is below noise_max, the LEDs will be switched of again.

let noise_x = 0
let signal_max = 0 let noise_5 = 0 let noise_25 = 0 let noise_max = 0 basic.showString("Noise") noise_max = 0 noise_25 = 0 noise_5 = 0 signal_max = 250 basic.forever(function () { while (input.buttonIsPressed(Button.B)) { basic.showNumber(envirobit.getSoundLevel()) basic.showString("--") } if (input.buttonIsPressed(Button.A)) { noise_max = 0 basic.clearScreen() } noise_25 = Math.floor(envirobit.getSoundLevel() / signal_max * 25) if (noise_25 > 24) { noise_25 = 24 } noise_5 = Math.floor(noise_25 / 5) noise_x = noise_25 - noise_5 * 5 led.plot(noise_x, noise_5) basic.pause(200) if (noise_25 < noise_max) { led.unplot(noise_x, noise_5) } if (noise_25 > noise_max) { noise_max = noise_25 } })
Attachments

# data[].attributes.attachment_link.description
Micro:bit Noise Level Detector: This is just a short example for a noise level detector based on the micro:bit and the Pimoroni enviro:bit.The microphone on the enviro:bit detects the sound level, and from the resulting value a position on the 5x5 LED matrix is calculated and th...

# data[].attributes.headline
mesurer des hauteurs avec micro:bit en Scratch3

# data[].attributes.subject
mesurer des hauteurs avec micro:bit en Scratch3

# data[].attributes.attachment_link.readable_text
In this tutorial we will use two micro:bits to broadcast messages to each other over bluetooth. This would be incredibly useful if teachers wanted students to code secret messages for a story, share historical facts with one another, make your own "heads up" game or even have teachers broadcast questions to students. The possibilities are really only limited by our own imagination. If I have learned anything in the last thirteen years in education, it is that students' imaginations are much more powerful than mine! I bet they could find a really creative and authentic use for a micro:bit messaging app! Check out the tutorial below!

Now this is really cool!! Check out -> Coding a Messenger App With Micro:Bit #CodeBreaker #CSForAll Click To Tweet

(Visited 1,410 times, 1 visits today)

# data[].attributes.attachment_link.description
In this tutorial we will use two micro:bits to broadcast messages to each other over bluetooth. This would be incredibly useful if teachers wanted students to code secret messages for a story, share historical facts with one another, make your own "heads up" game or even have teachers broadcast questions to students.

# data[].attributes.attachment_link.description
Getting Started: 1. Connect microbit to usb port. Follow any directions that appear on the Microbit Screen. Then look on your desktop to see if the Microbit Icon mounted. It will look like a USB...

# data[].attributes.attachment_link.readable_text
Post in News by Laura Jakubowski on 11th December 2018

Introducing micro:bit

Micro:bit, supplied by SparkFun, is one of the coolest new tools to get students engaged hands-on with Computer Science. The micro:bit is a small, programmable computer that allows students to learn to code while also creating fun projects as a result of that code. In the Teq offices, we have had a lot of fun playing with micro:bit, creating new bits of code, and experimenting as we go!

Micro:bit activities for the classroom

Here are some great micro:bit projects to teach the basics, and then help your students grow their skills as they experiment and play.

Students will learn how to create a string with text. It's one of the first things you want students to learn when they are learning to code. The end result will be an awesome text based answer each time the input is placed on the micro:bit.

This project is a bit of a physical one, since students will use alligator clips and headphones to "hack" their micro:bit and headphones. Essentially, they will be learning about the input and output of the micro:bit. At the end, they will have a handy little headphone trick up their sleeves.

Rather than use hands, students will use if, then, else conditions to create their own shakable "Rock, Paper, Scissors" game. If they have two micro:bits on hand, two students can go head to head and face off their micro:bits against each other in an epic battle of three LED outputs!

While you might think that your Fitbit is turning you into a digital pet you have to keep alive, this activity really challenges students in terms of coding to create their own digital pet. They will use if, then, repeating, and showing specific items on screen when a function is called. This project will result in the students creating a pet of their own that they'll have to monitor.

Once students are up and running with the micro:bit, be sure to have them try to create their own projects and games with the micro:bit! There is so much you can do. Check out the micro:bit website for more project ideas, resources, and classroom applications!

To learn more about teaching students STEM in your classroom, check out our Teq Online PD course library.

# data[].attributes.attachment_link.title
Top micro:bit Projects for Students - Teq

# data[].attributes.attachment_link.description
Post in News by Laura Jakubowski on 11th December 2018 Micro:bit, supplied by SparkFun, is one of the coolest new tools to get students engaged hands-on with Computer Science. The micro:bit is a small, programmable computer that allows students to learn to code while also creating fun projects as a result of that code.

# data[].attributes.attachment_link.title
micro:bit【マイクロビット】プログラミング教育・フィジカルコンピューティングにおすすめの教育用小型コンピューター | micro:bit Lab.【マイクロビット】

# data[].attributes.attachment_link.description
こどものプログラミング教育から、趣味の電子工作まで応用の範囲も広く、まさにフィジカルコンピューティングにおすすめのmicro:bit(マイクロビット)の魅力を紹介しています。

# data[].attributes.attachment_link.description
The Raspberry Pi can be used with micro:bit in a number of interesting ways, from monitoring the weather to controlling Minecraft! Check out the great project resources below!

# data[].attributes.attachment_link.title
Micro:bit: Displaying Values Like an Abacus

# data[].attributes.attachment_link.provider_name
Scratch 3 - MicroBit and Marty :: Robotical

# data[].attributes.attachment_link.readable_text
Earlier in the year, the Scratch team announced the release of the Scratch 3 beta. Quickly after, the team at Robotical developed our own Scratch 3 extension to bring Marty to the Scratch 3 platform. Now two months after the release of our extension, we have been experimenting with cross product programming.

One product we have been experimenting with is the BBC Micro:bit. The Micro:bit is a small inexpensive microcontroller that allows for basic programming and includes features such as an accelerometer and a 24 LED grid.

During his weeklong work experience with us, Nick (a S4 Highschool student) experimented with Scratch 3 using both Marty and a Micro:bit together to enhance the coding possibilities. He broke the code down into three sections, with three core functionalities:

Section one - Using the Micro:bit to feedback information about Marty:

This section uses the 25 LEDs on the Micro:bit to give feedback on how Marty is doing. The main chunks of code tell the user three things:

1. The first requires a little explanation: Marty has a built-in safety that will help to turn off the servo motors when there is to much strain on them, this helps to make sure that Marty doesn't break. Nick programmed the Micro:bit to present textual feedback using its 24 LED grid to indicate if a motor had been turned off, and signal if the user needs to re-start the motors before programming can commence.

2. The second acts to mirror the first in that it uses the Micro:bit's 24 LED grid to indicate if all the motors are on, and Marty is ready to be programmed.

3. The third chunk considers the time loops in place throughout the code and tells the user when the loop has started over.

Section two - Marty movements:

This section details the movement of Marty the robot. Again, this section can be broken down into chunks of code:

1. The first chunk focuses on getting Marty to walk forward, backwards and sidestep simply by moving the Micro:bit in the direction you want Marty to move. This utilizes the Micro:bit's internal accelerometer to detect the direction.

2. The next chunk uses the two buttons on the Micro:bit: the first, to stop all of Marty's motors and freezes him if you need him to stop moving quickly. The second button is used to perform the opposite and starts Marty up again by turning on all the motors.

3. The final chunk consists of several little parts that simply make life a little easier. Snippets such as: resetting the LEDs on the Micro:bit and getting Marty to stand up straight. These sections do not use the Micro:bit directly but have the potential to provoke a reaction if they indirectly turn off the motors for example.

Section three - Marty's battery:

This section controls the reactions to Martys battery. Using the Micro:bit's 24 LED grid, we have programmed the Micro:bit to display the battery level textually. If the battery is at max, it will display "FULL", if the battery is very low it will say "DEAD" and if the battery is in between, it will display a percentage. With the full release of Scratch coming early 2019, we will see a great increase in the ease of cross product communication and collaboration. We will also see the first instance of Scratch on iPads and tablets, bring coding even closer to pupils of all ages.

You can find our Scratch 3 extension here. We welcome your feedback and look forward to hearing all about your experiments!

# data[].attributes.attachment_link.title
Scratch 3 - MicroBit and Marty :: Robotical

# data[].attributes.attachment_link.description
Earlier in the year, the Scratch team announced the release of the Scratch 3 beta. Quickly after, the team at Robotical developed our own Scratch 3 extension to bring Marty to the Scratch 3 platform. Now two months after the release of our extension, we have been experimenting with cross product programming.

# data[].attributes.attachment_link.readable_text
A Microbit Game: Competitive Math Training Thru Microbits

(Master Version)

Developed by: Philip Ching Cua (MLC Ventures Singapore)
https://www.mlcventuressg.com/
In Collaboration with: Marcus Loo Cua (Angsana Primary School, SIngapore)

A Microbit-based game to help teachers train their students in math through a fun & competitive manner.

Game is composed of 1 Master Microbit (Teacher) & multiple Client Microbits (Students).

Master sends out a math equation (randomised) to all Clients and waits for their answers. First Client to answer correctly, wins. First Client to get 5 wins will get a "W" icon on his device. All Clients' winning tally will be reset once one Client hits the 5 wins so a fresh round of tallying will begin anew.

Master & Client Microbit Hardware Set Up

The hardware assembly of the Master & the Clients Microbits are similar. Only the type of software copied into the Microbit will differentiate a Master Microbit from a Client Microbit. (For the Client version, please visit: https://www.hackster.io/philip-cua/competitive-math-training-thru-micro-bits-client-version-7e9f96)

First, assemble the MI:Power Board kit into the BBC Microbit motherboard. After which, assemble the MI:pro Protector Case into the Microbit with the attached powerboard.

Copy the Master Hex program file into one of the assembled Microbit as the Master. And copy the Client Hex program into the rest of the assembled Microbits to act as Client Microbits.

Alternatively, you may also assemble Microbit sets using the motherboard and the regular triple AAA battery case should you not be able to procure the Kitronik case and powerboard.

Master Microbit:

ButtonA will generate an equation composed of 2 numbers and send the equation out to the Clients. The equation will be displayed on Master's screen as well as on Clients' devices.

Pressing ButtonB on Master will display the answer to the equation.

Pressing ButtonA will re-display the previously generated equation.

Master waits for Clients to send in their answers. The first correct answer received will be the winner. A tick mark will be displayed once a correct answer is received. A message will be sent to the winner Client Microbit and his device will display the tick mark also. For first Client to get 5 wins, he will get an additional "W" icon on his device. All Clients' winning tally will be reset once one Client achieves 5 wins, so a fresh round of tallying begins anew.

ButtonA+B on Master will reset the game but not the winning tally.

After reset, pressing ButtonA will send out a new equation.

To accommodate two different levels of students, upon Shake, the game Level will change, either from L0 to L1 (more difficult) or from L1 to L0 (less difficult).

Client Microbits:

An equation will be displayed on Client devices when the Master sends out an equation.

Client player computes the answer to the equation and keys in his answer using ButtonA & ButtonB.

ButtonA displays a single digit representing the first digit of the answer.

ButtonB displays a single digit also, representing the second digit of the answer. Answers will always be limited to 2 digits only.

The single digit starts at 0.... pressing the button again will increase it by 1 until it reaches 9 then it goes back to 0 again.

Once the answer has been set through ButtonA & ButtonB, pressing ButtonA+B will send the answer to the Master.

If the answer is correct & the Client is the first to answer correctly, a message will be received from the Master indicating Client is the winner. A tick mark will be displayed on Client device. First Client to achieve 5 wins will receive an additional "W" icon on his device. All Clients' winning tally will be reset to zero once one player achieves 5 wins.

Wrong answers will not get any response from the Master Microbit.

To recall back the equation, upon Shake, the equation will be re-displayed on Client screen.

# data[].attributes.attachment_link.title
Competitive Math Training Thru Microbits (Master Version)

# data[].attributes.attachment_link.description
A Microbit Game: Competitive Math Training Thru Microbits (Master Version) Developed by: Philip Ching Cua (MLC Ventures Singapore) https://www.mlcventuressg.com/ In Collaboration with: Marcus Loo Cua (Angsana Primary School, SIngapore) A Microbit-based game to help teachers train their students in math through a fun & competitive manner.

# data[].attributes.attachment_link.description
How we worked through the initial prototyping stage of a Christmas project idea. This is what happened before we got stuck into the CAD.

# data[].attributes.attachment_link.description
There's even an emergency stop feature built into the micro:bit software. Yes, we know that not everyone is quite as into Xmas as you are and that a quick way to stop that delightful Xmas tune might just come in handy. So we programmed the buttons on the micro:bit to stop the current audio and LED display immediately.

# data[].attributes.attachment_link.description
Pre-order the GiggleBot Base Kit today and begin programming using MakeCode. Get GiggleBot Robot today, add your BBC MicroBit to it and you are ready to start programming. Our GiggleBot robot is made of a solid body and shaped organically so it can be turned into whatever you like: a butterfly, a cricket, or anything else.

# data[].attributes.attachment_link.readable_text
Programming

Visual

PXT - Provides an in-browser emulator and a Blocks interface that generates JavaScript (TypeScript) code.

Microsoft Blocks - A Block interface that produces Touch Develop code. No longer in development and it's recommended to use PXT instead.

Code Kingdoms - A graphical interface that provides a transitioning experience from 'drag and drop' to text-based programming (JavaScript).

Scratch for BBC micro:bit - Using micro:bit with Scratch / S2Bot as a Bluetooth 'games controller' (needs specific BLED112 Bluetooth dongle).

Open Roberta Lab - A block programming environment design for programming robots, it also supports the micro:bit by generating MicroPython.

ScratchX micro:bit extension - Lets you control your micro:bit wirelessly using Scratch programming blocks.

Python

MicroPython - Port of MicroPython, a Python 3 implementation for microcontrollers and constrained environments.

MicroPython Editors

MicroPython Libraries

Python Libraries

Python Programming Tools

JavaScript and PXT

Node.js Libraries

JavaScript Programming Tools

PXT Command Line Tool - Use the command line to program the micro:bit with PXT JavaScript. You can also run a local version of the PXT online editor.

C/C++

C/C++ runtime - Guidance on how to start using the runtime in C/C++ including full documentation of the APIs, drivers, and types that make up the micro:bit runtime. Bluetooth documentation includes a link to the original *.hex file that ships on the micro:bit devices.

Arduino nRF5 - Arduino Core for Nordic Semiconductor nRF5 based boards, including the micro:bit.

C/C++ Editors

Micro:Pi - A C/C++ editor with serial monitor and deploy functionality. Written in Python with an installer (ATM Linux only, but could be manually installed in any OS) that includes all dependencies.

C/C++ Libraries

OneWire - micro:bit OneWire Library, based upon Erik Olieman's mbed DS1820 lib.

neopixel - Library for using neopixels with the BBC micro:bit.

Other Languages

Touch Develop - A flexible, text-based programming language with an interactive visual component.

Rust on BBC micro:bit - Describes the experience and steps of compiling Rust code for the micro:bit with and without interaction with the runtime DAL.

Forth - Forth, a stack-based language, for the BBC micro:bit.

Pascal - The Free Pascal compiler can also target the ARM embedded platform, including the micro:bit.

Ada - Instruction on how to setup the Ada development environment for the micro:bit.

Programming Tools

Mobile Apps

Official Android App (Source Code) - Pair, program and flash programs to the micro:bit via Bluetooth.

Official iOS App - Pair, program and flash programs to the micro:bit via Bluetooth.

micro:bit Blue (Source Code) - Android app that contains a series demos for interacting with the micro:bit using Bluetooth.

Bitty Software Apps - A diverse collection of Android and iOS apps, going from data logging to audio pranks, you'll certainly find something of interest.

Insight Mr Bit (iOS) - Create simple programs in plain English to control the BBC micro:bit to do lots of useful things.

Micro:bit Xamarin (Source code) - Android app that demonstrates communicating with BBC micro:bit over Bluetooth LE and getting sensor data. As an open source app, it's a good example of using Xamaring with the micro:bit.

bitty blue - iOS and Android app that provides a collection of fun things to do with a BBC micro:bit (or compatible device) and Bluetooth.

micro:bit logger - Android app that enables users to log data from the BLE services and export it to a file.

Interface Chip

The USB Interface Chip is the microcontroller placed close to the battery connector. It provides the USB mass storage capability to load the micro:bit firmware using the Operating System file explorer.

microbit.org Developer Community Info - This micro:bit Developer Community page contains information about the Interface Chip DAPlink and the USB interface.

DAPLink on micro:bit - The DAPLink is the default software running on the Interface Chip, this page contains information, update instructions, and the latest firmware.

DAPLink source code - Source code for the mbed DAPLink, contains the build configuration for the micro:bit.

J-Link OB Firmware - Offers the same flashing functionality than the DAPLink and expands it to include J-Link debugging.

pyOCD - Python library for programming and debugging ARM Cortex-M microcontrollers, like the one included in the micro:bit, using the CMSIS-DAP provided by the Interface Chip.

Hardware

Hardware Design - Schematics and bill of materials for the BBC micro:bit.

micro:bit Reference Design - Hardware design files for a board 100% binary compatible with the micro:bit. Created to help make your own micro:bit derived designs.

micro:bit Badge - Open Source PCB for the micro:bit with a battery holder, buzzer, extension edge connector and pins breaks out.

Eagle micro:bit Edge Part - Eagle librarie from Proto-Pic for the micro:bit edge connectors.

Kicad micro:bit Connector - A KiCad component library and footprint library for a micro:bit edge-connector socket.

SparkFun Breakout Board - Open source files for the SparkFun micro:bit Breakout Board.

CAD & 3D Printing

Projects

All these projects contain steps and resources required for reproduction.

Articles

Useful Articles for developing on the micro:bit.

Videos

Books

Teaching Resources

Miscellaneous

microbit Fritzing Part - Richard Hayler collection of Fritzing parts contains a model for the micro:bit.

micro:bit broadcast - Free newsletter to stay up-to-date with the latest micro:bit news, articles, projects, and resources.

micro:bit-o-matic - Easily create micro:bit illustrations with custom LED matrix messages.

microbit.org Support - The support pages from the micro:bit Foundation is a great source of information, containing an extensive collection of FAQs, articles, and guides.

# data[].attributes.attachment_link.description
Programming Visual PXT - Provides an in-browser emulator and a Blocks interface that generates JavaScript (TypeScript) code. Microsoft Blocks - A Block interface that produces Touch Develop code. No longer in development and it's recommended to use PXT instead. Code Kingdoms - A graphical interface that provides a transitioning experience from 'drag and drop' to text-based programming...

# data[].attributes.attachment_link.title
Resources for Learning with the BBC Micro:bit - Through The Classroom Door

# data[].attributes.attachment_link.description
Comprehensive list of BBC Micro:bit links and resources

# data[].attributes.attachment_link.title
PLEN:bit Is a Cute Little Bipedal Robot Built on the Educational BBC micro:bit

# data[].attributes.attachment_link.description
A good educational robot needs to be two things: simple enough that anyone can build it, and fun enough that they'll want to. The new PLEN:bit bipedal robot fits that philosophy perfectly, and just...

# data[].attributes.attachment_link.description
accelerometer Ambient Light Sensor Arduino Block Editor Color Sensor HDC1080 humidity sensor image infrared thermometer LDR light sensor MAG3110 magnetometer MicroBit Micropython OLED pressure sensor RGB led temperature temperature sensor

# data[].attributes.attachment_link.readable_text
The VL53L0X is a Time-of-Flight (ToF) laser-ranging module housed in the smallest package on the market today, providing accurate distance measurement whatever the target reflectances unlike conventional technologies. It can measure absolute distances up to 2m, setting a new benchmark in ranging performance levels, opening the door to various new applications.

The VL53L0X integrates a leading-edge SPAD array (Single Photon Avalanche Diodes) and embeds ST's second generation FlightSenseTM patented technology.

The VL53L0X's 940 nm VCSEL emitter (Vertical Cavity Surface-Emitting Laser), is totally invisible to the human eye, coupled with internal physical infrared filters, it enables longer ranging distances, higher immunity to ambient light, and better robustness to cover glass optical crosstalk.

Shopping List

Should be able to pick up one of these sensors from $3 to $4

Schematics/Layout

Code

Again we use a library and again its an adafruit one - https://github.com/adafruit/Adafruit_VL53L0X

The default example worked fine, so here it is

Output

Open the serial monitor - this is what I saw. I moved an object closer to the sensor hence the readings decreasing

Reading a measurement... Distance (mm): 84
Reading a measurement... Distance (mm): 49
Reading a measurement... Distance (mm): 47
Reading a measurement... Distance (mm): 47
Reading a measurement... Distance (mm): 49
Reading a measurement... Distance (mm): 48
Reading a measurement... Distance (mm): 52
Reading a measurement... Distance (mm): 44
Reading a measurement... Distance (mm): 43
Reading a measurement... Distance (mm): 42
Reading a measurement... Distance (mm): 46
Reading a measurement... Distance (mm): 41

Links
https://www.st.com/resource/en/datasheet/vl53l0x.pdf https://www.st.com/en/imaging-and-photonics-solutions/vl53l0x.html VL53L0X Time-of-Flight (ToF) Laser Ranging Sensor Breakout

# data[].attributes.attachment_link.title
VL53L0X Time-of-Flight sensor and micro:bit example

# data[].attributes.attachment_link.description
The VL53L0X is a Time-of-Flight (ToF) laser-ranging module housed in the smallest package on the market today, providing accurate distance measurement whatever the target reflectances unlike conventional technologies. It can measure absolute distances up to 2m, setting a new benchmark in ranging performance levels, opening the door to various new applications.

# data[].attributes.attachment_link.readable_text
Musab is a 13 year-old Maker from Turkey. Below is his brilliant Motorbike Simulator Make tutorial, all powered by the micro:bit!
Hi, I'm Musab, a 13 year-old programmer. I started programming 3 years ago and developed myself over time - read more about my journey in this blog post!

Today I'm going to show you one of my projects, using micro:bit as a game controller. We will test it on a game called Road Rash(It could be any game but I will show this as an example).

Note: It works only for Windows.

Setting up the Enviroment

Instructions

First, go to https://www.python.org/download/releases/2.7/ , then download and install Python 2.

Second, connect your micro:bit to your computer and go to the MicroBike folder. Send the file named "bitio.hex" to the micro:bit.

Then, start install.bat to install the required packages. You can close when you see the message "Installation Finished!"

Now, you are ready to go! Just run the controller.py and open the game. You can start the controller by pressing the button A or B.

Understanding the Code

We made the controller, but how? Let's review the code and see how this works.

We need import the modules to use them later. We will use 3 modules; microbit module for controlling and reading data from the micro:bit, time module for waiting for a specific time step and pykeyboard module to control the keyboard(and the game of course).

changeKeyState is a function, it will help as to control the keyboard keys. For example if the handlebar goes left, it will press the left arrow key.

We will define some variables to use them later.

This is the first loop. It will keep blinking until the user(motorbike driver!) presses the A or B button. After pressing the button controller will start running.

This is the main loop. We will start by getting required values and calculating the motion.

Then we will use the information we get before to control the game. Keyboard keys will trigger when the microbit turns right or left higher than a specific value.

We will use same information for changing the direction on the microbit.
That's all! Thanks for reading :)

# data[].attributes.attachment_link.title
Use micro:bit to Control a Motorbike Simulator

# data[].attributes.attachment_link.description
Musab is a 13 year-old Maker from Turkey. Below is his brilliant Motorbike Simulator Make tutorial, all powered by the micro:bit! Hi, I'm Musab, a 13 year-old programmer. I started programming 3 years ago and developed myself over time - read more about my journey in this blog post!

# data[].attributes.attachment_link.readable_text
Using external input and outputs with physical computing devices can be intimidating for learners new to working with micro controllers. There are many add on boards available which can simplify the process, however class sets of these can be expensive. Therefore I wanted to design a very cheap and easy to make board that could scaffold the introduction of external inputs and outputs. My completed design works with the BBC micro:bit and features 3 LEDs, 3 switches, a button and a speaker, copper slug barrier tape is used to connect the components.
Resources Required:

Copper slug barrier tape

3mm Red, Yellow and Green LEDs - example

2.7mm piezo speakers - example

Paper fasteners

A4 card

Follow these steps to create your own boards:

Print this input-output board template onto A4 card and cut in half.

Cover the light gray areas with copper slug barrier tape (you may need to cut the tape in half to get the correct width).

Make a hole in the middle of each switch circle with a paper fastener. Insert a paper fastener into each hole from underneath and open out. Ensure they make good contact with the copper tape, but will still easily pass over it.

Open out another paper fastener and use a small piece of copper tape to secure the short side of the paper fastener in place to form the button as shown in the picture.

Secure a 2.7cm piezo speaker in place with a sticky fixer. Connect the end of the wires in place with small pieces of copper tape, ensure the red wire goes to the right and the black wire goes to the left.

Bend the legs on the 3 LEDs outwards, lay them flat as shown in the picture and secure each leg in place with a small piece of copper tape. Ensure you place the LEDs the right way around, if one leg is longer it should point right and the flat side of LED should face left.

I've put together these example activities to demonstrate how the boards can be used in the classroom. The code for the starter program can be found here.

# data[].attributes.attachment_link.title
Simple DIY Input/Output Board for BBC micro:bit

# data[].attributes.attachment_link.description
Using external input and outputs with physical computing devices can be intimidating for learners new to working with micro controllers. There are many add on boards available which can simplify the process, however class sets of these can be expensive.

# data[].attributes.attachment_link.description
Blog del taller de robótica en primaria perteneciente al Programa Andalucía Profundiza.

# data[].attributes.attachment_link.readable_text
Prices are calculated on cart weight and are displayed on checkout page
Orders placed before 16:00 GMT on weekdays are dispatched on the same day
Orders placed after 16.00 on Fridays will be dispatched the following Monday
All orders are Delivered Duty Unpaid.

Standard Shipping Via Royal Mail and NOT TRACKABLE

United Kingdom - 1-2 days
Europe - 3-5 working days
North /South America - 7-10 working days
Africa / Asia / Oceania- 7-10 working days

Priority Shipping
Via courier with tracking information emailed on dispatch

United Kingdom - 1 day
Europe - 1-3 working days
North / South America - 5-7 working days
Africa / Asia / Oceania - 5-7 working days

_______________
Countries we unfortunately CANNOT SHIP TO are: Afghanistan, Armenia, Azerbaijan, Belarus, Benin, Burma (Myanmar), Burkina Faso, Burundi, Cape Verde, Democratic Republic of Congo, Eritrea, Gambia, Ghana, Guinea, Guinea-Bissau,Iran, Iraq, Ivory Coast, Liberia, Libya, Macau, Mali, Niger, Nigeria, North Korea, Rwanda, Senegal, Sierra Leone, Somalia, South Sudan, Sudan, Syria, Tanzania, Togo, Turkmenistan, Tunisia, Uganda, Western Sahara, Zimbabwe *We are only able to ship via standard shipping to Brazil and Russia (not tracked).
Free Shipping Promotion
From time to time, we may offer free Standard Shipping to our customers. Enter your special free shipping coupon code at checkout and choose Free Standard Shipping. This may be limited to certain countries, be for a limited time, or only be available above a certain basket value, according to the conditions of the individual coupons. If you need faster shipping than standard, please choose Priority Shipping instead.

# data[].attributes.attachment_link.title
How to create a touch sensor for the micro:bit with Electric Paint - Bare Conductive

# data[].attributes.attachment_link.description
Prices are calculated on cart weight and are displayed on checkout page Orders placed before 16:00 GMT on weekdays are dispatched on the same day Orders placed after 16.00 on Fridays will be dispatched the following Monday All orders are Delivered Duty Unpaid.

# data[].attributes.attachment_link.readable_text
We know how much educators have been loving the micro:bit for classroom use, so here at SparkFun we decided to develop an ecosystem that would make the micro:bit even easier to use and safer to work with for teachers and students alike. Introducing the gator:board ecosystem - a series of four gator-clippable accessories designed specifically to interface with the micro:bit.The diverse set of components found on the gator:boards will allow your students to explore a wide range of interactive projects and empower them to continue learning STEAM topics. These boards offer classroom longevity as they are accessible to the youngest of students, yet capable enough for more advanced middle and high school students.

Today we are going to look at the gator:bit, one of our four gator:boards and definitely the bell of the ball, the gator:bit acts as a carrier caseand expanded prototyping environment for the micro:bit. Almost all of the tiny pins found on the micro:bit are broken out on this board to large, kid friendly, gator-clippable pads, which are electrically protected from over current or short-circuits, making this board exceptionally safe for young students and impossibly hard to blow up! In addition to breaking out and protecting many of the micro:bit pins, the gator:bit features a buzzer for added sound and 5 addressable RGB LEDs. With all of the sensing capabilities already found on the micro:bit, the gator:bit adds a few extra actuators and expands out the pins, allowing for even more interactive ideas and expressions.

Learn more about the gator:bit features and how to take advantage of this incredible classroom tool in the video below!

# data[].attributes.attachment_link.description
We know how much educators have been loving the micro:bit for classroom use, so here at SparkFun we decided to develop an ecosystem that would make the micro:bit even easier to use and safer to work with for teachers and students alike.

# data[].attributes.attachment_link.description
From dancing robots to banana keyboards, your micro:bit has all the features you need to code awesome stuff - the possibilities are endless!

# data[].attributes.attachment_link.readable_text
The Kitronik ZIP Halo for the BBC microbit incorporates 24 colourful ZIP LEDs. It also has an 'extension' connection point that allows extra ZIP LEDs to be connected and controlled by the Halo. This tutorial shows how simple and quick this is to do.

To do the following you will need a Kitronik Halo, a BBC microbit, a ZIP LED variant such as the ZIP Circle, and the MakeCode Editor (previously known as the PXT Editor). This tutorial also requires a little soldering.

Adding Extra ZIP LEDs To Halo For The BBC microbit:

The image below shows the location of the connector for adding extra ZIP LED s. This is a three-way connector. The pads (spaced at 0.1" / 2.54mm) can be soldered to directly or can be used to connect pin headers if the extra ZIP LEDs don't want to be permanently connected to the Halo.

These connections will need connecting to the corresponding connections on the extra ZIP LEDs. In this example, we will be using a ZIP Circle as shown below. There are four connecting points on the ZIP ring but we will only need to connect to three, as the GND connection is duplicated on the ZIP Circle.

The connections should be made (soldered) as follows:

Once these have been done, the two boards will be connected as shown below.

So now we have the 24 ZIP LEDs on the Halo and 12 more ZIP LEDs on the ZIP Circle giving us 36 in total that can be controlled. When coding, the ZIP LEDs on the Halo come first and then follow on to the ones connected to the extension port.

The following code gives a simple example of how to set the blocks up to control the 36 LEDs. A rainbow will be displayed and rotated (moved) across all 36 LEDs.

The results will look like this.

Download:

You can download the code for Halo here or directly from the embedded editor below:

Learn more about the author read more "

If you don't yet have a Halo or ZIP LED variant, you can grab what you need from the links below:

# data[].attributes.attachment_link.title
Adding Extra ZIP LEDs To The Kitronik Halo

# data[].attributes.attachment_link.description
The Kitronik ZIP Halo for the BBC microbit incorporates 24 colourful ZIP LEDs. It also has an 'extension' connection point that allows extra ZIP LEDs to be connected and controlled by the Halo. This tutorial shows how simple and quick this is to do.

# data[].attributes.headline
Lever de fonds pour l'internet des objets LORA

# data[].attributes.subject
Lever de fonds pour l'internet des objets LORA

# data[].attributes.attachment_link.title
IoT LoRa Boards - Your Gateway to the Internet of Things

# data[].attributes.attachment_link.description
Pi Supply is raising funds for IoT LoRa Boards - Your Gateway to the Internet of Things on Kickstarter! Making LoRa cheaper, more accessible and hackable using your favourite single board computers - Raspberry Pi, Arduino and Micro:Bit!

# data[].attributes.attachment_link.readable_text
Issue Two

The all new micro:mag Issue Two is here! We've got an improved design and a glorious 96 pages of content for you to enjoy, here's a sneak peek of what we have to offer this issue, enjoy!

Scratch + micro:bit

This issues Cover feature is all about Scratch 3.0 and it's new micro:bit blocks. We've got all sorts of things for you in the new and exciting cover feature. Michael Rimicans teaches us the basics of Scratch 3 and micro:bit and Eileen King shows us how to make our own Scratch games controller, these are just some of the articles to enjoy in this issues cover feature.

Make your own MakeCode Blocks

Dexter Industries CTO, Nicole Parrot, shows us how to expand the capabilities of MakeCode for the micro:bit by adding our own custom blocks to do cool things. This is a great tutorial for beginners and experts wanting to make their micro:bit makecode experience better.

Plus, a selection of extra things in Issue Two:

Countdown Timer: Les Pounder guides us through how to make a countdown timer in micro:hit 2.

Micro:bit & Kodu: Learn how to connect your micro:bit to Kodu Game Labs to make your games interact with the real world.

Reviews of: 4Tronix cube:bit, Dexter Industries GiggleBot, DFRobot's expansion board and Kitronik's :GAME ZIP 64!

Hack:Bit 2018: Learn about the worlds first national level micro:bit hackathon where schools and teams got together to make cool micro:bit projects.

Information on other articles can be found in the contents pages.
Contribute to Issue 3:

If you'd like to write an article for the next issue of micro:mag, head over to micromag.cc/contribute to fill in the form!
micro:mag is released under the Creative Commons Attribution-NonCommercial
ShareAlike 4.0 (CC-BY-NC-SA 4.0) International License.

# data[].attributes.attachment_link.description
The all new micro:mag Issue Two is here! We've got an improved design and a glorious 96 pages of content for you to enjoy, here's a sneak peek of what we have to offer this issue, enjoy! This issues Cover feature is all about Scratch 3.0 and it's new micro:bit blocks.

# data[].attributes.attachment_link.readable_text
In this tutorial we will use two micro:bits to broadcast messages to each other over bluetooth. This would be incredibly useful if teachers wanted students to code secret messages for a story, share historical facts with one another, make your own "heads up" game or even have teachers broadcast questions to students. The possibilities are really only limited by our own imagination. If I have learned anything in the last thirteen years in education, it is that students' imaginations are much more powerful than mine! I bet they could find a really creative and authentic use for a micro:bit messaging app! Check out the tutorial below!

Now this is really cool!! Check out -> Coding a Messenger App With Micro:Bit #CodeBreaker #CSForAll Click To Tweet

(Visited 1,410 times, 1 visits today)

# data[].attributes.attachment_link.description
In this tutorial we will use two micro:bits to broadcast messages to each other over bluetooth. This would be incredibly useful if teachers wanted students to code secret messages for a story, share historical facts with one another, make your own "heads up" game or even have teachers broadcast questions to students.

# data[].attributes.body
Basic:bit un addon 3 voies + buzz

# data[].attributes.attachment_link.readable_text
Description

Sometimes we wonder if robotics engineers ever watch movies. If they did, they'd know that making robots into servants always ends up in a robot rebellion. Why even go down that path? Here at Adafruit, we believe in making robots our friends!

So if you find yourself wanting a companion, consider the robot. They're fun to program, and you can get creative with decorations.

With that in mind, we designed Crickit - That's our Creative Robotics & Interactive Construction Kit. It's an add-on to the BBC's micro:bit that lets you #MakeRobotFriend using MakeCode or Arduino.

Plug your :bit into the 40 pin edge connector and start controlling motors, servos, solenoids. You also get signal pins, capacitive touch sensors, a NeoPixel driver and amplified speaker output. It complements & extends micro:bit so you can still use all the goodies on the :bit, but now you have a robotics playground as well.
Please note at this time that MicroPython is not supported yet, just MakeCode & Arduino!
The Crickit is powered by seesaw, our I2C-to-whatever bridge firmware. So you only need to use two data pins to control the huge number of inputs and outputs on the Crickit. All those timers, PWMs, sensors are offloaded to the co-processor.

You get:

4 x Analog or Digital Servo control, with precision 16-bit timers

2 x Bi-directional brushed DC motor control, 1 Amp current limited each, with 8-bit PWM speed control (or one stepper)

4 x High current "Darlington" 500mA drive outputs with kick-back diode protection. For solenoids, relays, large LEDs, or one uni-polar stepper

4 x Capacitive touch input sensors with alligator-pads

8 x Signal pins, can be used as digital in/out or analog inputs

1 x NeoPixel driver with 5V level shifter - this is connected to micro:bit pin #16 so you can use MakeCode's built-in NeoPixel control

1 x Class D, 4-8 ohm speaker, 3W-max audio amplifier - this is connected to micro:bit pin #1 which is the default audio output

All are powered via 5V DC, so you can use any 5V-powered servos, DC motors, steppers, solenoids, relays etc. To keep things simple and safe, we don't support mixing voltages, so only 5V, not for use with 9V or 12V robotic components.
Please note this robot board does not require any soldering but you will need a power supply and a micro:bit to go along with the Crickit, and these are not included! We recommend also purchasing: And of course we have a huge collection of all compatible motors, servos, solenoids, speakers and more in our Crickit category
Since you'll be working with high-current devices, we wanted to have a good solid power supply system that minimizes risk of damage. The power supply has an 'eFuse' management chip that will automatically turn off if the voltage goes above 5.5V or below 3V and has over-current protection at 4A. Every motor driver has kick-back protection. We think this is a nice and durable board for robotics!
Lots more details, schematics, specifications, and code examples in the Adafruit Learn guide.

# data[].attributes.attachment_link.keywords[]
adafruit crickit for micro:bit : id 3928 tools gift certificates arduino cables sensors leds books breakout boards power el wire/tape/panel components & parts lcds & displays wearables prototyping raspberry pi wireless young engineers 3d printing neopixels kits & projects robotics & cnc accessories cosplay/costuming halloween reseller and school packs internet of things - iot development boards batteries feather circuitpython circuit playground crickit - creative robotics particle stemma machine learning micro:bit add-ons & accessories bluetooth ppe microchip mechanical keyboards ecommerce

# data[].attributes.attachment_link.description
Adafruit Industries, Unique & fun DIY electronics and kits Adafruit CRICKIT for micro:bit : ID 3928 - Sometimes we wonder if robotics engineers ever watch movies. If they did, they'd know that making robots into servants always ends up in a robot rebellion. Why even go down that path?

# data[].attributes.attachment_link.description
MicroMaker | Begin your digital making journey with us

# data[].attributes.attachment_link.readable_text
These goggles are a lot of fun. I wouldn't recommend wearing them for anything like.. walking or cycling or moving in anyway! Your vision is definitely obstructed! Think of them as a sit down party costume :D
I attach them to a bowler hat cause it gives you somewhere to mount the micro:bit. Here's the Hubster modelling them in a Mad Hatter's costume

1. The ZIP circles need pins soldering onto them. You can buy some of the Zip range with pins already soldered on but not 2 circles together: https://www.kitronik.co.uk/5603-zip-zip-leds-add-on-pack-for-kitronik-inventors-kit-for-microbit.html

2. Connect 3 female to female jumper wires to +5V, DIN and GND on the circle pins

3. Connect 3 male to female jumpers to these wires, this makes the wiring longer so it can reach the goggles from the back of the hat.

4. From the circle to the breakout board, connect
a. +5V to 3V
b. Connect GND to 0V
c. Connect DIN to 0

5. Do steps 2 to 4 for the second circle except on step c, connect DIN to 1

7. Plug the micro:bit into the edge connector breakoutboard and code it before attaching everything to the hat

Add the Neopixel package

1. Go to microbit.makecode.com

2. Add the Neopixel package

1. Select Advanced

2. Select Add Package

3. Select Neopixel

There are two circles connected to the micro:bit. They are not connected in series. So we need to declare two variables, LeftEye and RightEye and set them to the neopixel strips on Pin0 and Pin1

Put some rainbow code to test the lights:

To learn how to create the code above see the previous post:
http://lorraine.mcunderwood.org/power-rangers-light-up-sword/

Download and test the code

1. Plug your micro:bit into your computer with a USB cable

2. Select Download

1. In Chrome the file will go to your Downloads folder. Go to your Downloads folder and drag your file onto the micro:bit

2. In Internet Explorer it will ask you where to save your file to. Select "Save As" then select the micro:bit

Enjoy your shiny goggles!
Try creating some flashing code by changing the colour of each eye

Instead of using the normal battery pack which is awkward, can dangle and only takes 2 AAAs try out the bat:bit from proto-pic. It has 2 AAs and the micro:bit sits in front of the batteries and (most importantly) it has an on/off switch.

Full disclosure: I ordered a cool arm keyboard from proto-pic and they put a bat:bit and other things in the parcel, for free.

The micro:bit slots in front of the batteries:

Then it can slot into the edge connector:

Shiny!

# data[].attributes.attachment_link.description
These goggles are a lot of fun. I wouldn't recommend wearing them for anything like.. walking or cycling or moving in anyway! Your vision is definitely obstructed! Think of them as a sit down party costume :D I attach them to a bowler hat cause it gives you somewhere to

# data[].attributes.attachment_link.readable_text
This is a much-simplified version of the MakeCode Hot/Cold game using Python. You hide beacons, players have to find them.

You will need:
- 2 or more micro:bits with battery packs
- a computer with which to program them
- optional: headphones or micro:bit speakers

You can hide as many beacons as you want. Using Mu or the online Python editor you put the following Python program on the beacons, changing the ID number so each is unique. Beacons constantly transmit their ID numbers as a string and show their ID number on their displays:

from microbit import *
import radio
id = "1"
display.show(id)
radio.config(power=0) # low power so you must get close
radio.on()

while True:
    radio.send(id)

In the very simplest version of this game (which should work with the online Python editor or current releases of the Mu Python editor) the players use the following program. This displays an X until a signal is received from a beacon - it should show the beacon's number for half a second every time it gets a signal. Even though the beacon is set to transmit on low power, it will still get a signal if you are a metre or two away, so this is best played over a large area:

from microbit import *
import radio
radio.on()

while True:
    message=radio.receive()
    display.show(Image.NO)
    if message:
        display.show(message)
        sleep(500)

Players should see how many beacons they can find in an allotted time. This simple player code doesn't log them, it just relies on memory and trust!
WORK IN PROGRESS: More sophisticated versions of player code showing signal strength below require Beta version of Mu 1.0.0 beta 15 or higher
This next version of the player code ignores the ID but displays a number from 1 to 5 showing how strong the signal is. X means no signal received. You could use this to play the game in a smaller area, and you could still use multiple beacons but their IDs are not shown to the player - until they find the beacon of course, when they can read its own display!

from microbit import *
import radio
radio.on()

while True:
    message=radio.receive_full()
    if message:
        strength = message[1]+100
        displaystrength = (int((strength/10)+1))
        display.show(str(displaystrength))
        sleep(200)
    else:
        display.show(Image.NO)

Now to be a bit more like a metal detector, it would be nice to have some audio feedback. This next program will play a short note when it receives a signal. The stronger the signal, the higher the pitch, so you can use this to find the beacon.

Attach a micro:bit speaker to the GND and 0 pins. CAUTION: if you attach normal headphones DO NOT WEAR THEM, just put them round your neck just like Lance and Andy in the photo at the top of this page - the sound is very loud. Or put a 3K ohm resistor between pin 0 and the headphones.. You could have some fun making a 'metal detector' as I did in the picture above with an old broom handle and some rubber bands.

Here's the program for the noisy version. As before, this currently needs a beta version of Mu to flash this to your microbits.

from microbit import *
import radio,music
radio.on()

while True:
    message=radio.receive_full()
    if message:
        strength = message[1]+100
        displaystrength = (int((strength/10)+1))
        display.show(str(displaystrength))
        music.pitch(strength*50,100)
    else:
        display.show(Image.NO)

If you try this out and have ideas for improvements, please let me know!

To do:
- Add logging of beacon numbers and some visual feedback on players' micro:bits when all beacons found.

This entry was posted in computers, microbit and tagged Microbit, Python. Bookmark the permalink.

# data[].attributes.attachment_link.description
This is a much-simplified version of the MakeCode Hot/Cold game using Python. You hide beacons, players have to find them. You will need: - 2 or more micro:bits with battery packs - a computer with which to program them - optional: headphones or micro:bit speakers You can hide as many beacons as you want.

# data[].attributes.attachment_link.readable_text
Up to 25 pupils each has a micro:bit which they can use for voting YES or NO to any question. Pupils press button A to answer 'no' to a question, or button B to answer 'yes'. They can shake their micro:bits to display their ID number and clear the display.

The answers are displayed in a grid on the teacher's micro:bit's display - dark/black pixels mean that person has not yet voted, dim ones mean a 'no' vote was recorded and bright ones mean a 'yes' vote was received from that pupil. The teacher can press button A to clear her micro:bit's display.

This is based on another MakeCode project, the Voting Machine, again simplified and translated into Python.

Flash this program on to the teacher's micro:bit:

from microbit import *
import radio
radio.on()

while True:
    message = radio.receive()
    if message:
        id = message[:2]
        vote = message[2:]
        print(id,vote)
        x = int(id[:1])
        y = int(id[1:])
        if vote == "0":
            bright = 4
        if vote == "1":
            bright = 9
        display.set_pixel(x, y, bright)
    if button_a.was_pressed():
        display.clear()

And flash the following program on to the pupils' micro:bits. The ID numbers need setting according to the diagram above. (It's the cunning use of these ID numbers that makes the code simpler). You might want to sit the class in a 5 x 5 grid if that's possible - I do, however, appreciate class sizes are normally more than 25!

from microbit import *
import radio
radio.on()
id = "00"
display.scroll(id)

while True:
    if accelerometer.was_gesture("shake"):
        display.scroll(id)
    if button_a.was_pressed():
        display.show(Image.NO)
        radio.send(id+"0")
    if button_b.was_pressed():
        display.show(Image.YES)
        radio.send(id+"1")

It works by each voter's micro:bit transmitting a 3 digit string such as
031
This would mean voter ID number 03 has voted 'yes'. If they voted 'no' it would send '030′. The teacher's program splits the string up to identify the column (0) and row (3) of the voter, and lights the appropriate pixel bright for a 'yes' vote and dimly for a 'no'.

You could also have fun drawing pictures or perhaps playing games like noughts and crosses with this or use it so pupils can say they need more help with a topic without the embarrassment of putting their hands up.

Version 2: add vote counting

Here's a more advanced version of the teacher's program. This one counts the Yes and No votes and displays them on the teacher's display when button B is pressed, e.g. 'Yes:2 No:5′. It then clears the display, so only use this when everyone has voted.

from microbit import *
import radio
radio.on()

def countvotes():
    yes = 0
    no = 0
    for column in range(5):
        for row in range(5):
            if display.get_pixel(column, row) == 4:
                no += 1
            if display.get_pixel(column,row) == 9:
                yes += 1
    votes = "Yes:"+ str(yes) + "   No:"+str(no)
    return(votes)

while True:
    message = radio.receive()
    if message:
        id = message[:2]
        vote = message[2:]
        print(id,vote)
        x = int(id[:1])
        y = int(id[1:])
        if vote == "0":
            bright = 4
        if vote == "1":
            bright = 9
        display.set_pixel(x, y, bright)
    if button_a.was_pressed():
        display.clear()
    if button_b.was_pressed():
        display.scroll(countvotes())

Version 3: Allow teacher to clear all screens

This version allows the teacher not just to count the votes cast but also clear pupils' screens and ask them to vote again. It has slightly different code for both pupils and teacher. The teacher presses button B as before to count up the 'yes' and 'no' votes, but pressing button A will clear all the pupils' displays and scroll the word 'vote!' across them.

Pupil program version 3:

from microbit import *
import radio
radio.on()
id = "00"

display.scroll(id)

while True:
    if accelerometer.was_gesture("shake"):
        display.scroll(id)
    if button_a.was_pressed():
        display.show(Image.NO)
        radio.send(id+"0")
    if button_b.was_pressed():
        display.show(Image.YES)
        radio.send(id+"1")
    message = radio.receive()
    if message == "vote":
        display.scroll("vote!")

Teacher program version 3:

from microbit import *
import radio
radio.on()

def countvotes():
    yes = 0
    no = 0
    for column in range(5):
        for row in range(5):
            if display.get_pixel(column, row) == 4:
                no += 1
            if display.get_pixel(column,row) == 9:
                yes += 1
    votes = "Yes:"+ str(yes) + "   No:"+str(no)
    return(votes)

while True:
    message = radio.receive()
    if message:
        id = message[:2]
        vote = message[2:]
        print(id,vote)
        x = int(id[:1])
        y = int(id[1:])
        if vote == "0":
            bright = 4
        if vote == "1":
            bright = 9
        display.set_pixel(x, y, bright)
    if button_a.was_pressed():
        radio.send("vote")
        display.clear()
    if button_b.was_pressed():
        display.scroll(countvotes())

It would be cool to add some feedback on a large screen - perhaps have a micro:bit communicating with a program on a computer to display a grid of yes/no answers - or just point a visualiser at the teacher's micro:bit?

# data[].attributes.attachment_link.description
Up to 25 pupils each has a micro:bit which they can use for voting YES or NO to any question. Pupils press button A to answer 'no' to a question, or button B to answer 'yes'. They can shake their micro:bits to display their ID number and clear the display.

# data[].attributes.attachment_link.readable_text
Games on the MicroBit are way more fun when they make noise.

Here are 3 ways of making sound that I've tried with things I had lying around the house, in ascending order of usefulness / awesomeness:

1) A loudspeaker. I bought this one from Pimoroni for a Raspberry Pi radio project that I've not yet completed. I attached it using crocodile clips from a MakeyMakey kit to pins 0 and GND on the MicroBit and ran some Python code on the MicroBit like this.

Pros: loudspeakers are quite easy to find.
Cons: fragile, highly magnetic - and very quiet!

2) An old earpiece. No idea where this came from - an ancient radio perhaps. I attached the crocodile clips to the 2 pins on its jack plug.

Pros: Very loud. Cheap.
Cons: TOO loud. Do not place anywhere near your ear canal.

3) A buzzer thingy from an Arduino kit. Not sure what its proper name is, but I had a couple of these as one came with a RaspberryPi CamJam kit too.

Pros: Very loud, cheap, tiny.
Cons: None!

So the buzzer is the way to go. I want to try a buzzer from a musical birthday card, but I can't lay my hands on one at the moment - I have a hunch they would be really good too.

I also made my own battery pack - 2 AA batteries in a holder that I took off some broken Christmas lights - attach the + side to the 3v terminal on the MicroBit, and - to the GND terminal, and I have a switchable, portable power supply for making self-contained MicroBit projects.

This entry was posted in Uncategorized and tagged BBCMicrobit, Microbit. Bookmark the permalink.

# data[].attributes.attachment_link.title
3 ways of making sound with the BBC MicroBit

# data[].attributes.attachment_link.description
Games on the MicroBit are way more fun when they make noise. Here are 3 ways of making sound that I've tried with things I had lying around the house, in ascending order of usefulness / awesomeness: 1) A loudspeaker. I bought this one from Pimoroni for a Raspberry Pi radio project that I've not yet completed.

# data[].attributes.attachment_link.readable_text
If you're the proud owner of one of the BBC's new micro:bit microcomputer, you may be looking for some new projects to get your teeth into.

The micro:bit has been designed for beginners with next to no knowledge of programming. Still, you may be surprised by what its 16MHz ARM CPU is capable of.

We've scoured the web for the best BBC micro:bit projects we can find, and have listed them below in the hope they inspire you to try your own.

If you're just getting started with the micro:bit, we recommend you check out a few of the tutorials, uploaded by the BBC and its partners to the micro:bit website. For those already familiar with coding, you'll find plenty to try yourself in the projects below. Good luck.

Getting started

For each of these projects you can either follow the chosen programming language, or follow the guidance and adapt the steps for one of the other three programming languages supported by the micro:bit.

The programming language the Micro Bit supports are:

CodeKingdoms JavaScript: a graphical drag-and-drop interface and text-based interface, good for beginners

Microsoft Block Editor: a graphical drag-and-drop editor

Microsoft Touch Develop: a text-based language, which comes pre-installed with a library of micro:bit commands

MicroPython: a robust, text-based editor used by professional software developers

You can find tutorials and information about each of these programming languages on the micro:bit site.

Morse Code Machine

By John Goodman (M0RVJ)

Because multiple Micro computers can talk to each other via shortwave radio signals, it's perfect for using as a Morse Code machine. This demo by John Goodman shows a BBC micro:bit hooked up to a pair of CW transceivers.

While one can be used for inputting the dashes and dots in sound using a pizo buzzer, while the other is hooked up to a speaker. It also features capacitive touch for inputting the code with just a few taps of the finger on the micro:bit. The code is stored in the memory as letters, so you can easily see what code has been sent between the two for reference (or if you're not adept at translating the beeps produced by the board.

The micro computers are coded using Micropython and John has made the code available on GitHub. He's finessed the design since its original implementation to boost the range throughout a building and it now includes a menu that you can use by shaking the device.

See the full project.

Micro Traffic Lights

By Anish Ansari

What can you do by hooking up breadboard, three resistors and jumper wires to a BBC micro:bit? Create a traffic light system that cycles through coloured LEDs like traffic lights. You can control the order of the lights and their brightness to make the perfect lineup for a micro city, for example.

The board is programmed using Microsoft MakeCode, although the developer has also included the MicroPython code for those that prefer more advanced coding.

See the full project.

Micro Morse Phone

By Technology Will Save Us

The BBC micro:bit can be used to send simple radio messages, which is all you need to communicate in Morse code. The Micro Morse Phone project allows several micro:bits to talk to each other using Morse by sending dots or dashes. This tutorial will walk you through using the micro:bit radio library and teach you how to make a Morse translation code book.
See the full project
Frustration

By Code Club

Frustration is a very basic but oh-so addictive game that you're quite possibly familiar with already. It consists of a metal hoop or loop that you have to guide along another metal wire without the two touching. If contact is made, a buzzer goes off and you have to start again. This project shows you how to make your own version of the game, with the micro:bit showing the number of attempts, rather than making a noise.
See the full project
Metronome

By Will.I.Am and the BBC

The BBC micro:bit can be used to keep time with music. The Metronome-like project was developed in association with musician and technologist Will.I.Am. It uses a piezo buzzer alongside the micro:bit to make a noise and show an image on every beat to help the tempo keep in check. The tempo can also be slowed down or speeded up.
See the full project
Flashing heart

By Microsoft Block

One of the simplest micro:bit projects to cut your teeth on is to make the device's LED grid form a flashing heart. You can create the code in the Microsoft Blocks graphical editor. The BBC tutorial will guide you through how to do this, and once you've got your head around it, the same principals can be used to make other shapes.
See the full project
micro:bit countdown timer

By 101 Computing

We can't think of many practical uses for a nine-second countdown timer - besides using it to trial 100-metre Olympic sprinters. However, 101 Computing's tutorial is a novel example of how the LEDs can be used to display numerals.
See the full project
Micro badge adaptor

By Technology Will Save Us

Projects by Technology Will Save Us frequently engage your craft skills as well as your coding skills. This tutorial will guide you through how to make a fabric badge, with battery pouch, from your micro:bit, for LED images or animations. You need to code the micro:bit's LED display first, though, so take a look at another project - such as the flashing heart - if you're not familiar with how to initiate static or animated patterns.
See the full project
Combination Lock

By BBC Make It Digital and Wolfblood

Combination Lock is an easy way to protect your stuff and even to warn you of burglaries. The project relies on using the micro:bit to detect whether a circuit is complete or broken. By creating a circuit of copper tape and attaching a buzzer, your micro:bit will sound an alarm when the protected box, door, or drawer is opened. This tutorial walks you through setting up your very own lock and passcode.
See the full project
Touch arpeggiator

By Technology Will Save Us

This is one of the most fun and relatively simple Micro Bit projects so far. Inspired by the BBC Touch Develop tutorial 'Banana Keyboard', it guides you through how to turn your Micro Bit into a touch-activated tone generator. All you need is an electronic buzzer, four wired crocodile clips, a micro-USB cable, and, erm, some fruit. Using this method, you could even play musical scales with more than one buzzer.
See the full project
micro:bit step counter

By The Institute of Engineering and Technology

"I'm walking out the door with my micro:bit on my mind..." is what you could be saying with if you follow this exquisite, and more involved, guide on how to turn your micro:bit into a stepometer. Following this project you'll be able to create a working stepometer that could compete with commercial equivalents.
See the full project
Remote selfies

By Samsung

Ever wanted to take selfies on your smartphone with a remote control? Well, you can do exactly that by pairing your micro:bit with an Android handset. This project will suit intermediate and advanced users, and involves a fair amount of coding to trigger the camera and implement the wireless connectivity. Don't forget, for this project you'll need to have access to an Android smartphone and Samsung's micro:bit app.
See the full project
LED circuit game

By Intense Computer Training

This project, from Intense Computer Training, is actually a fair straightforward circuit game. Following the video tutorial (no text version available at the time of publishing), you'll learn how to code the LED display so that individual LEDs can represent your counter on the five-by-five grid.
See the full project
micro:bit racing game

By 101 Computing

This project is a ridiculous slice of work-time fun that's just waiting to engage (or possibly disrupt) classrooms and lunch halls in Britain. Following this tutorial you'll turn the micro:bit's LED display into a drag racing game for up to five players. 101 Computing guides you through creating the game and duplicating the code for additional players.
See the full project
micro:bit Temperature reader

By Proto-Pic

The micro:bit can also be turned into a pretty decent temperature reader, which is quite useful given the UK's 2017 heatwave that saw temperatures edge over 30°C. While it lacks a heat sensor, you can configure it to display the temperature of, say, a CPU, which is pretty handy for PC builders. Things get even more interesting when you add a thermistor to the micro:bit, which can be dipped into food and drinks to record the temperature directly - though this requires some advanced coding and is only for the most dedicated micro:bit enthusiasts.
See the full project
Images in this article courtesy of the respective parties behind each project

# data[].attributes.attachment_link.description
Learn everything from beginner projects to challenges for confident coders

# data[].attributes.attachment_link.readable_text
In this video we will build an app that chooses two random numbers and multiplies them together. The goal of the lesson is to create a game for students to practice multiplication tables (or addition, subtraction, division). As I mention in the video, there is plenty of opportunity to differentiate (two digit, three digit numbers, smaller ranges, etc.) to meet the needs of all students.

(Visited 317 times, 14 visits today)

# data[].attributes.attachment_link.title
Coding to Learn: Multiplication Tables & Micro:Bit

# data[].attributes.attachment_link.description
In this video we will build an app that chooses two random numbers and multiplies them together. The goal of the lesson is to create a game for students to practice multiplication tables (or addition, subtraction, division). As I mention in the video, there is plenty of opportunity to differentiate (two digit, three digit numbers, smaller ranges, etc.)

# data[].attributes.body
permet de télécharger directement le programme dans le micro:bit à partir du navigateur web

# data[].attributes.attachment_link.title
Flashing the micro:bit with webUSB : Support

# data[].attributes.attachment_link.description
How to use webUSB to flash a program to your micro:bit. Currently in beta

# data[].attributes.attachment_link.readable_text
The Beta version of Scratch 3 (In the video above an example of the pen moving under micro:bit control is shown. Also, some discussion of setting up Scratch to work with the micro:bit is included. The best source for the instructions to set up the micro:bit/Scratch combination and the links needed is https://scratch.mit.edu/microbit) allows certain physical computing devices to interact with the Scratch; including the micro:bit. This post looks at a little experiment with the micro:bit; producing a pen that moves around the screen controlled by tilting a micro:bit.

Set-up
https://scratch.mit.edu/microbit. The key features are:
- The programming of the Micro:bit via Scratch is not done by downloading a new .hex file each time as you do with the python or the javascript blocks but is done through the Scratch Link which has to be run separately to the Scratch editor each time you have a session using Scratch and the Micro:bit. There is a version for both windows and OS X.
- One program/hex file is downloaded on to the micro:bit to form the link between the micro:bit and scratch.

Microbit and Pens The experiment was to get a micro:bit to control a pen around the screen and draw (the video above shows the pen moving around under micro:bit control but not drawing).

The key to all of this the little blue icon at bottom left of the editor; this allows extra blocks/features to be added. You first need to connect a micro:bit; click on the blue icon and select the micro:bit option and attach a micro:bit to your machine, the system should (hopefully) allow you to make a connection. As well as the micro:bit blocks you will need to add the pen blocks via the blue icon and the pen option.

The code (see below) does two basic things
- Press button B on the micro:bit resets the pen to a fixed starting point;
- Tilting the micro:bit forwards and backwards (once the green flag has been pressed) moves the pen forward or backwards in the direction that the pen is facing and tilting left or right turns the pen.

At the moment the pen is drawing as if the nib is in the middle of the pen (see below) but tilting the micro:bit does give rough control. It is fun, to mix Scratch and micro:bit.

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

# data[].attributes.attachment_link.description
The Beta version of Scratch 3 (https://scratch.mit.edu/microbit) allows certain physical computing devices to interact with the Scratch; including the microbit. This post looks at a little experimentation with the microbit; producing a pen that moves around the screen controlled a microbit.

# data[].attributes.attachment_link.readable_text
This is really part two of a set of post in response to a question from Carl Simmons ( @Activ8Thinking) concerning building amicro:bit simple neuron. In the previous post a single neuron was produced. This post looks at producing a network of neurons, ie. neural network; looking to solve the problem that a single neuron can't solve, making an Exclusive OR gate (XOR) 1. Quick Overview
1.1 The neuron itself

Inputs are going to be binary

Weighted sum is bias+W1*input1+w2*input2

If weighted sum>=0 then the output is True (T on the LEDs) or '1'

If weighted sum<0 then the output is False (F on the LEDs) or '0'

Essentially for the two input case if the two inputs are different then the output is True.

The figure below shows the arrangement of the connections; pin 2 is the output of the neurons. The two micro:bits/neurons on the left of the picture taking in the two inputs, the same inputs go to these two neurons; the output from these neurons are the two inputs to the output neuron on the right.

The micro:bit objects used in Figure 1 were produced using the micro:bit Frtzing diagram available at https://github.com/microbit-foundation/dev-docs/issues/36 thanks to David Whale (@whalleygeek ) for these. 2. Neuron 1

This is the top left neurone in figure 1. This neurone is set to produce an output of TRUE (pin 2 going high) when the first input goes low and the second input goes high. The code for it is shown below.

3. Neuron 2
This is the bottom left neuron in figure 1. This neurone is set to produce an output of TRUE (pin 2 going high) when the first input goes high and the second input goes low. The code for it is shown below.

4. Output Neuron
Neuron 1
This is the right-hand neurone in figure 1. This neurone is set to produce an output of TRUE (pin 2 going high) when either inputs (outputs from neurons 1 and 2) goes high - in other words acting as an OR gate . The code for it is shown below.
The overall effect is when the two inputs to the network are high/TRUE then the output of the network (this neuron) is TRUE.

5. In Action
The wiring is messy but the effect is possible to see in these images. The top neuron is the output neuron.

6. Room for expansion
The neurons were 'trained' in this case by selecting the weights by hand, an improvement would be to get them to learn. How to do this on a micro:bit takes a bit more thinking about, but I would be interested in seeing how others solve that problem.
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

# data[].attributes.attachment_link.title
How to produce a Microbit neural network

# data[].attributes.attachment_link.description
This is really part two of a set of post in response to a question from Carl Simmons (@Activ8Thinking) concerning building a micro:bit simple neuron. In the previous post a single neuron was produced. This post looks at producing a network of neurons, ie.

# data[].attributes.attachment_link.readable_text
As a child Roald Dahl's the BFG was one on my favourite stories. If you're not familiar with the story: a Big Friendly Giant visits children in their sleep and blows dreams into their bedrooms at night using a long trumpet and a jar of dreams that he caught in Dream Country. The dreams are lights inside that jar that change colour.

I decided to recreate the dream jar using a micro:bit and some RGB LEDs. I used bubble wrap in the jar to create the effect of a "dream" and it looks awesome! Below are instructions for adding one light but I think more would look good too.

A glass jar (I bought from St John's Hospice charity shop for 50p)

Some bubble wrap

micro:bit

1 x CodeBug GlowBug http://www.codebug.org.uk/shop/

3 x crocodile clips, preferably white.

Connect the crocodile clips from the micro:bit to the GlowBug

The micro:bit can power 5V lights with its 3V pin. It can power up to 8 of them

Add the Neopixel package

Before putting everything in the jar, let's code it!

1. Go to microbit.makecode.com

2. Add the Neopixel package

1. Select Advanced

2. Select Add Package

3. Select Neopixel

Setup the lights

Create a variable called lights

1. Select Variable

2. Select Create New Variable

3. Type "Lights"

4. Select OK

1. From the Variables menu drag out "Set item to 0"

2. Connect it under "On start"

3. Change item to Lights

4. From the Neopixel menu select the first block "Neopixel at pin 0.."

5. Drag this out onto 0

6. Change 24 leds to 1

Turn the lights on

1. From Input select "on shake" and drag it onto the screen

2. From Neopixel select "item show color red" and place it under on shake

3. Change item to lights

4. Change red to whatever colour you want

5. Add a test block to make sure Shake has happened: select Basic

6. Select "show icon" and choose an icon

7. Put it in "On shake"

Download and test the code

1. Plug in your micro:bit

2. Select Download

1. In Chrome the file will go to your Downloads folder. Go to your Downloads folder and drag your file onto the micro:bit

2. In Internet Explorer it will ask you where to save your file to. Select "Save As" then select the micro:bit

3. Shake your micro:bit

4. Ta-da!

Plug the micro:bit into your computer using a USB cable then shake it - did it work?
1. Yes: Your battery pack isn't working - does it have an on/off switch? Does it need new batteries?
2. No:
1. Check your code - have you changed item to lights?
2. Check the connections from your GlowBug to your micro:bit. With the same colour crocodile clips it's very easy to get them mixed up.

Now your micro:bit is coded:

1. Secure the crocodile clips onto the micro:bit using tape

2. Plug the battery pack into the micro:bit

3. Wrap the micro:bit and battery pack in bubble wrap

4. Line the jar with bubble wrap

5. Place the micro:bit in the jar

6. Put some bubble wrap in the jar

7. Place the light in the jar

8. Put some more bubble wrap in the jar

9. Test your setup to make sure it still works!

More Code

You can change the lights to lots of different colours, just add a pause between every time you "show color", e.g.

Or use loops to keep changing the lights over and over again

To turn off the lights you need to use lights clear followed by lights show:

What pattern are your dreams going to show? What does a nightmare look like?

# data[].attributes.attachment_link.description
As a child Roald Dahl's the BFG was one on my favourite stories. If you're not familiar with the story: a Big Friendly Giant visits children in their sleep and blows dreams into their bedrooms at night using a long trumpet and a jar of dreams that he caught in

# data[].attributes.attachment_link.readable_text
I have uploaded the python code to GitHub, so you just can download and upload to your Mu editor. Here is the link to the GitHub:

Main()

On the Main function is just a forever loop where the code is always checking if the door sensor is open while the alarm is activated. We need to check the value of the analog pin p0, if the contact is closed, the value will always 3, if the contact is opened, the value will vary and it will be more than 3.

SetSecretPin()

Is to set the PIN from the initial stage if the PIN has not been setup and to store the entered PIN in the Local persistent Filesystem that we are going to touch in the subsequent slides.

If the program has received the 4-digit PIN numbers, it will ask user for the confirmation. Once user has confirmed (by pressing the button A again), the PIN will be stored in the persistent FileSystem so micro:bit can remember the PIN even if the power is down.

Local Persistent File System

Micro:bit has a small file system to store the program when you flash your program. When the micro:bit is running, you can read, create and delete the files. The flash memory in micro:bit is persistent that means any data you stored, it will be available when the micro:bit is switched off and on though.

With that in mind, we need to design the bit:Locker to remember the PIN that was entered by the user during the PIN setup process. For this case, I am using the Local Persistent File System to store the PIN data in a persistent manner so it will remains intact between restarts of the device. Here is the piece of code to handle that.

I created the filename secret.txt to store the PIN in the form of array on the micro:bit. Once the file has been created, you can check from the Mu editor by clicking the Files menu and you will see the filename on your micro:bit

GetUnlock()

Is to compare the PIN that was stored earlier with the PIN that was entered by the user. If the PIN is match, the alarm will be deactivated. We also play some music with buzzer on pin 0 on the micro:bit to attract attention and make it more less bored :)

Global Variables

And finally, to link the status between all the functions, we need to have the global variables. We need to write some functions to set and get the value of global variables in microPython:

# data[].attributes.attachment_link.title
bit:Locker - micro:bit Front Door Security System - Ferry Djaja - Medium

# data[].attributes.attachment_link.description
I have uploaded the python code to GitHub, so you just can download and upload to your Mu editor. Here is the link to the GitHub: On the Main function is just a forever loop where the code is always checking if the door sensor is open while the alarm is activated.

# data[].attributes.attachment_link.readable_text
Qu'est-ce qu'une carte micro:bit ? Avec quelle interface peut-on la programmer si on est totalement débutant en programmation ? Et avec Scratch ou Python, c'est possible aussi ?

1. Qu'est qu'une carte micro:bit ?

La carte BBC micro:bit est une carte micro-contrôleur qui a été conçue - notamment par la BBC - dans un objectif pédagogique. Elle se programme à l'aide de différentes interfaces et différents langages, permettant à des élèves de tous niveaux d'aborder la robotique et d'interagir avec le monde réel.

Elle comporte :

25 LEDs,

deux boutons A et B programmables,

un bouton de réinitialisation,

des capteurs de lumière et de température,

des capteurs de mouvements (accéléromètre et boussole),

des broches de connexion

Les programmes se transfèrent dans la carte depuis un ordinateur à l'aide d'un câble USB connecté au port micro-USB ou sans fil par Bluetooth. Une liaison radio est également disponible pour faire communiquer plusieurs cartes micro:bit entre elles.
L'alimentation se fait par le port micro-USB lorsqu'il est connecté à un ordinateur ou à l'aide de piles.

2. Programmer la carte micro:bit

Plusieurs interfaces permettent de programmer la carte, dans différents langages. Deux interfaces sont actuellement développées et qualifiées d' officielles par le projet micro:bit : les blocs JavaScript et Python.
En parallèle d'autres éditeurs sont réalisés de façon indépendante pour programmer la carte micro:bit, dont l'interface s'appuyant sur Scratch.

2.1 Programmer la carte avec l'éditeur JavaScript Blocks de micro:bit

Cette interface, développée par MakeCode en partenariat avec micro:bit, se trouve en ligne et s'utilise directement dans un navigateur. Elle est sans doute idéale pour débuter : aucun pré-requis n'est nécessaire. On peut paramétrer l'affichage en français.
L'utilisateur manipule et emboite des blocs pour créer son programme. Celui-ci est ensuite à télécharger pour le copier dans la carte micro:bit. Le format du fichier téléchargé est.hex : c'est à la fois le fichier à copier dans la carte pour qu'elle l'exécute et celui à sauvegarder pour ouvrir ultérieurement le programme dans l'éditeur.
Pour ceux qui le souhaitent, le code Javascript construit à l'aide des blocs est visible en un clic et modifiable.
Par ailleurs le navigateur conserve les données du dernier programme réalisé et une ouverture ultérieure de l'éditeur affiche ce dernier programme par défaut.

Cette interface dispose d'un simulateur de la carte micro:bit qui permet d'observer le fonctionnement du programme et effectuer les premières corrections.

On trouve de nombreux exemples de référence sur le site de l'éditeur, ainsi qu'un guide de démarrage rapide.

La commission Inter IREM TICE a publié un guide (19 pages, pdf) intitulé Carte micro-contrôleur micro:bit, tome 1 - Prise en main et programmation par blocs

2.2 Programmer la carte avec l'éditeur Python de micro:bit

Cette interface, utilisant MicroPython, se trouve en ligne et s'utilise directement dans un navigateur.
Elle nécessite de connaître quelques bases du langage Python. Le module microbit est importé en début de programme.

Le programme est à sauvegarder (Save) au format habituel des programmes Python,.py, et à télécharger (Download) sur la carte micro:bit au format .hex.
Un guide d'apprentissage MicroPython a été réalisé pour découvrir le code spécifique à la carte micro:bit : images, boutons mouvement, radio, etc, sont présentés progressivement dans des exemples.
Une version avancée de l'éditeur, nommé Mu, peut être téléchargée pour une édition hors-ligne, qui présente notamment l'intérêt d'une auto-complétion lors de la saisie du code. Développé en Python, cet éditeur fonctionne sur Windows, MacOS, Linux et Raspberry Pi.

2.3 Programmer la carte avec Scratch

L' interface de programmation Scratch est l'un des éditeurs tiers de micro:bit. Elle s'appuie sur la version Scratch 3 et s'utilise dans un navigateur, sur ordinateur ou tablette. La connexion avec la carte micro:bit utilise le bluetooth.

Attention : la version 3 de Scratch est encore une version beta. Quelques fonctionnalités sont inexistantes ou limitées.

L'installation de l'interface complète est un peu plus longue que pour les autres interfaces, mais le téléchargement de chacune des versions du programme réalisé est immédiat, grâce à la liaison bluetooth. Un seul fichier .hex est à télécharger sur la carte au début, et il s'agit toujours du même fichier. Ensuite l'exécution du code se fait comme habituellement dans Scratch : double-clic sur un bloc d'instructions, drapeau vert, etc.

Lancer Scratch Link, à installer au préalable (lien de téléchargement et instructions)

Scratch Link

Connecter la carte à l'aide du câble USB et copier-glisser le code .hex du fichier scratch-microbit sur la carte micro:bit

Alimenter la carte micro:bit, à l'aide de piles ou du câble USB.

Ouvrir dans un navigateur l'interface de programmation Scratch 3

Cliquer sur l'icône d'ajout d'extension et choisir l'extension micro:bit. Choisir ensuite la carte micro:bit à connecter.
Dix nouveaux blocs d'instructions apparaissent pour programmer la carte. (Toutes les fonctionnalités ne sont pas encore accessibles.)

La carte peut être programmée en utilisant ses propres capteurs et actionneurs, mais la possibilité supplémentaire offerte par Scratch, c'est que la carte peut être utilisée pour interagir avec des lutins classiques de Scratch sur écran. Par exemple, dans le programme d'exemple joint, le crabe se déplace horizontalement en fonction de l'inclinaison de la carte, et tente d'attraper des diamants lorsqu'on appuie sur les boutons de la carte.

# data[].attributes.attachment_link.title
Découvrir la carte BBC micro:bit - Dane de l'académie de Caen

# data[].attributes.attachment_link.description
Qu'est-ce qu'une carte micro:bit ? Avec quelle interface peut-on la programmer si on est totalement débutant en programmation ? Et avec Scratch ou Python, c'est possible aussi ? La carte BBC micro:bit est une carte micro-contrôleur qui a été conçue - notamment par la BBC - dans un objectif pédagogique.

# data[].attributes.attachment_link.description
The Talking Compass is a simple project for the Micro:bit written in Python using the built-in compass and Python's Speech module. Find this and other hardware projects on Hackster.io.

# data[].attributes.attachment_link.readable_text
Published May 1, 2017 © GPL3+

Do you know your micro:bit can grow life? Look at a small universe that evolves.

Intermediate Full instructions provided 2 hours 1,744

Things used in this project

Hardware components

×

1

Software apps and online services

MicroPython - BBC micro:bit

Introduction

At each step, the universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells. Each of which is in one of two possible states, alive or dead, or "populated" or "unpopulated". Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:

Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.

Any live cell with two or three live neighbours lives on to the next generation.

Any live cell with more than three live neighbours dies, as if by overpopulation.

Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed-births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick (in other words, each generation is a pure function of the preceding one). The rules continue to be applied repeatedly to create further generations.

Extracted from the Wikipedia page about Conway's Game of Life.

In this implementation the universe is a toroidal 5x5 grid, this means the top 5 cells are adjacent with the bottom 5 cells, the same for the left and right cells. With a so small space available some patterns acts in a strange way, we start exploring it.

Quick start

Download the hex file below and upload it to the micro:bit. If you don't know how to upload the hex file you can find a tutorial here, the detailed instructions are in step 3.

OR

Go to this BBC micro:bit page, press "Create Code" and choose "MicroPython", now you are in the Python Editor. Remove the existing code and copy / paste the code below. Name your project (top right).n Follow the "Instructions" on the right to compile and upload the script to your micro:bit.

The script has 2 modes: "CONFIG" and "RUN".

In the CONFIG mode you can set up the start configuration, using the B button you can RUN it and watch the universe evolve, at any time you can modify the universe and watch what's happen.

CONFIG mode

Tilt: move the cursor.

Button A: enable or disable the cell under the cursor.

Button B: switch to CONFIG mode.

Button B: switch to RUN mode.

RUN mode

Some patterns to try

Blinker: an oscillator with period 2.

Toad: another oscillator with period 2.

Glider: a spaceship.

Line and dot: an oscillator with period 4.

The code explained

At rows 3 an 5 there are the 2 "draw" functions: draw_universe and draw_cursor. These functions sets the led luminosity at various levels, 0 for an empty cell, 9 for a populated cell, 4 for and empty cell with the cursor on it and 6 for a populated cell with a cursor on it.

The core is the function evolve (row 15) , in this function there are all the rules defined on top of this page.

At rows 33 and 39 there are 2 support function for evolve: cell_state and count_neighbours. In count_neighbours at row 43 there's the trick for the toroidal universe: the module operator (%). The same trick is in the row 73 and following.

At row 59 there's the main loop, it is basically divided in 2 parts: the RUN mode and the CONFIG mode.

The interesting thing here is the accelerometer managing at row 71. The accelerometer values (x, y, z) goes from -1024 to +1024, when it is flat the x and the y values are both (more or less) 0. In this case a grace zone of 200 is used to avoid unwanted cursor movements.

# data[].attributes.attachment_link.description
Published May 1, 2017 © GPL3+ Do you know your micro:bit can grow life? Look at a small universe that evolves. Intermediate Full instructions provided 2 hours 1,744 Things used in this project Hardware components × 1 Software apps and online services MicroPython - BBC micro:bit Introduction At each step, the universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells.

# data[].attributes.body
tutos sur les données physiques

# data[].attributes.attachment_link.readable_text
Make it: code it
Quick projects in MakeCode, Python & Scratch to help you get the most out of the micro:bit's features - and have fun!

do your :bit
Save the planet with technology - classroom activities based around the Global Goals and a global micro:bit challenge

# data[].attributes.attachment_link.description
Make it: code it Quick projects in MakeCode, Python & Scratch to help you get the most out of the micro:bit's features - and have fun! do your :bit Save the planet with technology - classroom activities based around the Global Goals and a global micro:bit challenge

# data[].attributes.attachment_link.readable_text
At Lancaster University I've been working on an energy project for schools.
Here's one of the experiments the students can reproduce using a micro:bit and a magnet.
https://www.youtube.com/watch?v=pBIzG7zMCUo
1 x micro:bit
1 x battery pack with batteries
1 x magnet
Cellotape
A door

Code the micro:bit before sticking everything to the door.

Find your range
The micro:bit can measure magnetic force strength. We need to know

the magnetic force strength when the magnet is next to the micro:bit?

the magnetic force strength when the magnet is as far away as the door opened

1. Use this code and put the magnet next to the micro:bit.

2. From Basic drag out "show number 0" and place it under forever

3. From Input > More drag out "magnet force x" and place it on top of 0

4. Change x to stength

When you download the code, the micro:bit will calibrate itself by asking you to draw a circle. Tilt the micro:bit around until you've drawn a circle using the lights on the front.

1. Write down the number. Wait and check a few times until the number is consistent.

2. Move the magnet away from the micro:bit.

3. Record the number. Wait and check a few times until the number is consistent.

When the magnet was away from my micro:bit, the value was 40. Sometimes it was 39, 38. So here's my code to record the number of times a door is opened:

Instructions on how to recreate the code:

1. From logic drag out "if else"

2. From logic drag out "0 < 0" and drop it onto the if statement

3. From input > more drag out "magnet force x" and drop it onto the first 0

4. Change x to stength

5. Change the second 0 to your magnet number

6. From basic drag out a icon to indicate the door has been opened

7. In the Variable menu create a new variable called doorOpened

8. From Variables drag out "change item by 1"

9. Change item to "doorOpened"

10. From Basic drag out "show number 0"

11. From Variables drag out "doorOpened" and drop it on the 0

I paused the micro:bit for 5 seconds (5000 milliseconds) to allow the door to close before recording another door open. How long does it take for your door to close? How often do people keep the door open for?

1. From basic drag out "pause (ms) 100"

2. Change 100 to the number of milliseconds it takes your door to close

1. Find a door that when opened decreases the temperature of the room

2. Cellotape the magnet to the edge of the door where it opens

3. Cellotape the micro:bit to the door frame

4. Plug in the battery

5. Open the door to test it's working

This experiment was used with others to try and help schools save money. A student would record the number of times the door was opened each day and reset it to start recording the next day. They would display the information each day and try to change behaviours so the door wouldn't be opened as much.

Lorraine Underwood - Irish, living in the UK. Coding, making, hacking, playing.

Read more posts by this author.

# data[].attributes.attachment_link.description
At Lancaster University I've been working on an energy project for schools. Here's one of the experiments the students can reproduce using a micro:bit and a magnet. https://www.youtube.com/watch?v=pBIzG7zMCUo Equipment 1 x micro:bit 1 x battery pack with batteries 1 x magnet Cellotape

# data[].attributes.attachment_link.description
A beginner maker activity, building a piano from bananas.

# data[].attributes.attachment_link.title
Totem Crab™ build it and bring to life with code | BinaryBots™

# data[].attributes.attachment_link.description
Totem Crab™ is one of the alien robots Binary found on Planet Totem. With a brand new BinaryBots sensor board and awesome pincer, bring the crab alive with code today!

# data[].attributes.attachment_link.description
Click on the boxes above to scroll the links for a section into view. There are over a hundred pages here, with ideas, examples and challenges to get you started with the micro:bit.

# data[].attributes.attachment_link.description
The BBC micro:bit is a small microcontroller based computer which was originally created to be handed out to 1 million eleven year old children in the United Kingdom. The micro:bit runs a special version of MicroPython. Mu was originally a contribution by the Python Software Foundation to this endeavour (along with the browser based editor on the project's website).

# data[].attributes.attachment_link.title
Lego Exploration Make - BBC micro:bit | Tech Will Save Us

# data[].attributes.attachment_link.description
Welcome to the BBC micro:bit Make page. Follow these steps to create the Lego Exploration. Start this project now!

# data[].attributes.attachment_link.description
Do you love Scratch and micro:bits? Then you need these Scratch activity cards. They provide an easy way for you to explore coding in Scratch 3.0 which is the version of Scratch that is expected to be available summer 2018.

# data[].attributes.attachment_link.readable_text
At Hackster we know that learning new technologies and tools for use in the classroom can be time consuming and daunting for many teachers. To help with this, we have partnered with the Micro:bit Foundation to create three short, informative video lessons that will give you the confidence to use the micro:bit in your classroom, without wasting time with extraneous details.

Watch the video version here:

A micro:bit is a tiny programmable computer, designed to make learning and teaching easy and fun.

Studies have found that using physical computing devices, like the micro:bit, in the classroom increases motivation, collaboration, creativity, and results in concrete understanding of programming concepts. In addition, the micro:bit can be used to teach concepts in many subject areas including math, science, engineering, and even arts!

When you receive your micro:bit, it will come in a box like this:

Open the box and inspect the contents

You will find a getting started guide and important safety instructions. Under the guides there is a small bag that contains the micro:bit. If you lift up the white cardboard in the box you will find a battery case, two AAA batteries, and the USB connector to connect the micro:bit to your PC. When you are using your micro:bit you can power it with your computer using the USB cable, or with the battery pack containing two AAA batteries.

Read the safety instructions

Insert the rectangle USB plug into a USB port on your computer.

Plug the other end of the USB into your micro:bit

When you connect your micro:bit to your computer you'll notice that your micro:bit lights up. This is the beginning of the demo display. Your micro:bit will prompt you to press button A, followed by button B then you'll see the word "SHAKE!" scroll across the screen. If you shake your micro:bit, you will see a light display. The final part of the demo will ask you to "CHASE" which means you will try to move the steady light dot to the same place as the flashing dot by tilting the micro:bit.

We will delve into two options for coding with your microbit in our next videos, but first let's go over the parts of the micro:bit and how they work.

The most distinct part of the micro:bit is the light display, which is on the front of the micro:bit.

This display is made of up a 5x5 grid of LEDs. LED is short for 'light emitting diode'. They were invented in the 60s, and since then have become popular as a low power lightbulb and have replaced halogen and flourescent bulbs in most homes and buildings. The 25 sparkly lights on the front of your microbit are LEDs.

They can be programmed to display various words and designs. You can also program the display to turn off or dim the brightness of the LEDs.

There is also a yellow light on the back of your micro:bit. This light will flash to indicate that something has changed like when you upload a new code to the micro:bit, that means the code has been successfully updated.

On either side of the LED grid display on the front of your micro:bit you will see a button. These buttons are labeled A and B and are used as input for the micro:bit. The micro:bit can detect which button is pressed and react to the button press or send information to another device depending on how you have programmed your micro:bit.

The button on the back of the micro:bit next to the USB connector is the reset button. Use this button to start your code from the beginning, or to run new code after you have uploaded it to your device.

The micro:bit has a built in compass that can be used to measure the magnetic fields around the micro:bit and determine the direction the micro:bit is facing. This information can be used in many different ways including turning the micro:bit into a compass, or to send directional information to another device.

The micro:bit has a built in accelerometer, which is used for detecting specific motions and the speed of the micro:bit.

Using the accelerometer, the micro:bit can detect when someone shakes, tilts, or drops the device. There are endless ways you can use this feature in your programs such as creating a pedometer that measures each step taken or measuring the acceleration of an object by attaching the micro:bit and sliding it down a ramp, or even just measuring movement like a shake of the micro:bit to simulate the roll a die like this example.

Each time you shake the micro:bit the accelerometer detects the movement and displays a random number from 1-6.

On the bottom of the micro:bit you will notice a "ruler" looking feature with holes and labels.

There are a total of 25 pins which are separated into small pins and large pins. You will mostly be using the large pins which are the pins with holes labeled 0, 1, 2, 3V, and GND which stands for ground.

Pins 0, 1, and 2 are general purpose input and output pins - abbreviated GPIO. These pins can be used for both input and output and can be connected to various devices such as thermometers or speakers using alligator clips or 4mm banana plugs.

When connecting your devices using alligator clips, be sure to grip the board between the jaws of the clip without overlapping any of the smaller pins. If you overlap with the smaller pins this may prevent your code from working properly.

The Pins Labeled 3V (three volts) and GND (ground) are the power supply pins. Make sure you never directly connect these pins together. The 3V pin allows you to power another device, or, if your micro:bit is not already being powered by your computer through the USB cable or external batteries, receive power from another device. Ground is used to complete the circuit if you are using your 3V to power another device.

The small pins are the unlabeled segments between the large pins on your micro:bit. These pins are beyond the scope of this video, but if you want to learn more, please visit http://microbit.org/guide/hardware/pins/ to see a labeled diagram and learn the function of each pin.

On the back of your micro:bit you can see the labeled "BLE Antenna" which stands for "Bluetooth Low Energy Antenna". This antenna allows the micro:bit to communicate with other devices, such as your phone or tablet, wirelessly by sending and receiving signals to and from that device:

The micro:bit also has the capability to detect temperature. While it does not have its own temperature sensor. The microprocessor chip, which can be found on the back of the board - The brains of our computer - can detect changes in temperature. This means that while the temperature is not necessarily accurate at determining the actual temperature and may be off by a few degrees, it is precise and great at measuring the change in temperature.

Now that you have learned the basic features of the micro:bit, you can move on to lesson 2 where we will teach you how to program the micro:bit using Javascript. If you are not planning on using Javascript and will be using python instead, you can go straight to lesson 3.

# data[].attributes.attachment_link.title
Micro:bit Basics for Teachers Part 1 - The Hardware

# data[].attributes.attachment_link.description
At Hackster we know that learning new technologies and tools for use in the classroom can be time consuming and daunting for many teachers. To help with this, we have partnered with the Micro:bit Foundation to create three short, informative video lessons that will give you the confidence to use the micro:bit in your classroom, without wasting time with extraneous details.

# data[].attributes.body
de bonnes idées pour le micro:bit

# data[].attributes.attachment_link.title
Micro:bit Tutorials and Store - Tinkercademy

# data[].attributes.attachment_link.description
Get started with the BBC Micro:bit and our Tinker Kit and custom Breakout Board! Tutorials and kits regularly updated. Available for purchase in Singapore.

# data[].attributes.headline
trieur de pièces de monnaie à ultra-sons

# data[].attributes.subject
trieur de pièces de monnaie à ultra-sons

# data[].attributes.attachment_link.description
Make a coin sorter with the micro:bit, an ultrasonic sensor, and LOT OF CARDBOARD.

# data[].attributes.attachment_link.title
BBC micro:bit | Free Platform for Coding, Making and Inventing | Make | Tech Will Save Us

# data[].attributes.attachment_link.description
The BBC micro:bit is a pocket-sized computer that you can code, customise and control to bring your digital ideas, games and apps to life.

# data[].attributes.attachment_link.title
BBC micro:bit | Micro:bit Electro Football | Free Platform for Coding, Making and Inventing | Make | Tech Will Save Us

# data[].attributes.attachment_link.description
Welcome to the BBC micro:bit Make page. Follow these steps to create the Micro:bit Electro Football. Start this project now!

# data[].attributes.attachment_link.readable_text
For my design I wanted to have a larger lower layer of perspex, with a smaller one on top where the Kitronik motor control board would sit, and the micro:bit would slot into that.

This design creates a space for wires, battery and power regulator if you need to use one. This will be covered later on.

I positioned the motor board onto the perspex and marked it out about 1cm wider than the board to give me some space to use the spacers between the 2 perspex sheets.

Note: Leave the covering on the perspex until you have cut and drilled it, this stops tools slipping or scratching the shiny perspex surface.

The smaller piece I measured to be the same width as the lower layer but was shorter in length. Just big enough to allow the motor board to sit easily with about 1 cm border around it.

I use a perspex cutter its like a stanley knife with a hooked end, and a metal ruler, to lightly score where I had marked I wanted to cut the perspex.

Once scored a number of times, you can lay the perspex on a sharp corner of a work surface or table, and then hit the over hanging bit of perspex with the palm of your hand, whilst holding firmly or clamping the other said on the surface you are using. This will snap the perspex if you have done it right, if not rescore the line you have marked.
Drilling the holes
Lay the motor board on the smaller of the 2 sheets in the position you will want it to be, use a small screw driver or sharp point to mark where to drill through the holes in the motor board, so using this as a template.

Also mark 4 holes to the side of where the terminal connectors are for the motors and 2 holes where the power connects.

# data[].attributes.attachment_link.title
Simple Micro:bit Robot With Lego Technics Wheels

# data[].attributes.attachment_link.description
For my design I wanted to have a larger lower layer of perspex, with a smaller one on top where the Kitronik motor control board would sit, and the micro:bit would slot into that. This design creates a space for wires, battery and power regulator if you need to use one.

# data[].attributes.body
E-Textile et tutoriels micro:bit

# data[].attributes.attachment_link.readable_text
This Kitronik University resource is for anyone interested in E-Textiles and wearables. For those who don't know what electronic textiles are we cover all of the basics including elementary circuit design, and basic do's and don'ts when using conductive thread. If you're looking for something more advanced we have a range of tutorials for many of our Electro-Fashion components including our Igloo, PICAXE wearable module.

Contents:

Introduction

If you're new to e-textiles and wearables we recommend you start here. You'll learn about the various components we have available in our very own Electro-Fashion range, how it all works, and we'll show you how to sew a basic circuit.

Getting started with e-textiles

When you're ready to start sewing we recommend you start with our getting started guides. We'll cover basics such as choosing and threading a needle, starting and finishing stitches, as well as looking at LEDs and switches.

The basics

Making custom components

One big advantage of soft circuits is the wide range of ways you can incorporate regular fabrics and textiles to create custom components. In this section we give you some ideas to get you started.

Programmable modules

As well as our own programmable Igloo board, we'll also teach you about the BBC micro:bit and the role it plays in wearable technology.
Igloo: The PICAXE wearable module
Our programmable Igloo board is our first wearable module. Using a PICAXE chip you can program the Igloo to control inputs and outputs, and much more.
BBC micro:bit
If you're new to the BBC micro:bit then start here, we'll explain what it is and how to use it.

E-Textiles Project Tutorials

Ready for a project but not sure where to start? Our huge range of complete step by step project tutorials take you through the process from start to finish.

Easy

These beginner E-Textiles tutorials are great for people with little or no experience in textiles or electronic circuits. The circuits are simple enough to reproduce and yet still allow you to add some bling to your own textiles project.

Intermediate

These tutorials assume some existing textiles skills, and an understanding of how electronic circuits work. They introduce concepts such as novel ways to include a switch within a circuit, and hacking existing products to add some sparkle!

Advanced

Coming soon.

Seasonal

These tutorials are great for seasonal projects and many include free templates.

Further inspiration

We've gathered some examples of our customers work, along with some project ideas from other sources such as Nottingham Trent University into a further section. Although not tutorials these can be a great place to find some extra inspiration.

# data[].attributes.attachment_link.title
E-Textiles and Wearables Tutorials & Resources

# data[].attributes.attachment_link.description
This Kitronik University course is for anyone interested in E-Textiles and wearables. For those who don\'t know what electronic textiles are we cover all of the basics including elementary circuit design, and basic do\'s and don\'ts when using conductive thread.