Second program to write text to a file and read the contents of the file, It has been written as I could not find an easy example of writing and reading to a file with the micro:bit. This is an extension to the first program about logging data. This program stores real time data (the… Continue reading micro:bit basic data logging 2
Tag: Python
micro:bit basic data logging 1
This is a first program to write text to a file and read the contents of the file again There are three parts to writing data to file:– opening the file– writing data– closing the file afterwards Line 3: opening the file The ‘open’ commands says open a file with name “storm.txt”; the w indicates… Continue reading micro:bit basic data logging 1
Part 4 – Displaying the Acceleration
When we ran the program last time, it was hard to see the numbers changing, as the numbers are only updated every half second. This is because the program has the line: sleep(500) The number passed to the function ‘sleep’ is in milliseconds (which can be written as ms), where 1000ms = one second. If… Continue reading Part 4 – Displaying the Acceleration
Week 2 – Meet the Accelerometers
This Microbit page introduces the accelerometers quite well:and provides a first program: The accelerometers measure how fast the microbit device is accelerating. Acceleration is the rate of increase of speed, and is often mentioned when people speak about cars, for example when someone says “…it accelerates well from traffic lights …” they are talking about… Continue reading Week 2 – Meet the Accelerometers
Week 1 – Hello World
The aim was to use the accelerometers of the microbit to calculate how far the device had moved Starting from basics, the first step was to get the microbit device out of the box and run a basic program on it. This seems obvious and a small step, but it moves the project from being… Continue reading Week 1 – Hello World