Weather:bit Wind Direction Question

I am using the Weather:bit to send the weather data to another micro:bit via the radio. I need to convert the wind direction to a numeric value. Are the possible return values for wind direction:

N,NE,E, SE,S,SW,W, NW?

Thanks in advance.

David

Hello David.

It looks like just cardinal directions are built into the weather:bit extension for MakeCode. Short of re-writing the extension, you’re stuck with letters and not numbers. You might be able to change your script so that when you receive a “NW” for wind direction you display 315 degrees. You’d just need to create a table of cardinal direction to degrees and then have your script figure out which number to display.