Serial Output
The ||led:plot bar graph||
block also writes the number from value to the serial port as a way to help you record
values.
Display a bar graph for a number value.
led.plotBarGraph(2, 20);
A bar graph is a kind of chart that shows numbers as lines with different lengths.
value
might be 0
if the temperature is 0 degrees Celsius.0
, then the largest value recently plotted is used as the maximum.The ||led:plot bar graph||
block also writes the number from value to the serial port as a way to help you record
values.
Show a bar graph of the acceleration
in the x
direction of the micro:bit.
The micro:bit’s x
direction is from left to right (or right to left).
The faster you move the micro:bit in this direction,
the taller the lines in the bar graph will be. The high paramter is 1023
which sets the highest possible value of acceleration to show.
basic.forever(() => {
let a = input.acceleration(Dimension.X);
led.plotBarGraph(a, 1023)
})