View on GitHub

pxt-vectors

Vector Data Type & Math Utilities. Send vectors over radio or serial channels by converting them to strings.

Open this page at https://matiasvlevi.github.io/pxt-vectors/

Makecode Vector Data Type

Adds the Vector Data type

main


Key Features:


Simple Read Example

Here we’re reading a vector from the radio. The vector was automatically converted to a string since it was used as one.

the recievedString can now be used as a read-only vector.

example


Mutable Vector Example

Since recievedString is not a vector instance, we need to convert it back to a vector and store it to be able to modify/mutate it.

In this example, a recievedPosition variable is set to the converted recievedString

we then add 1 to both x and y components

mutable


More blocks

Here are some included utilities

more


Use Extension

This repository can be added as an extension in MakeCode.