For questions regarding programming in Toit and using Toitware's end-to-end platform for network-connected, embedded devices and the internet of things.
Questions tagged [toit]
52 questions
0
votes
1 answer
How do I overload multiplication to the left in toit?
In the question Can I overload the + operator in Toit? it shows how to overload right-addition by another vector. If I have a vector class for example, how do I overload scalar multiplication to the left? In the code below, I would like z and y to…

S. Gammelmark
- 83
- 3
0
votes
1 answer
What does ? mean when used as a field initializer in Toit?
I'm writing code in Toit. I've seen a few uses of ? to initialize fields in classes. What does that mean?
class Point:
x ::= ?
y ::= ?

Kasper Lund
- 82
- 10
0
votes
1 answer
Can I overload the + operator in Toit?
I'm writing code in Toit. I would like to have the + operator do something meaningful when applied to one of my classes, Vector, that represent two-dimensional vectors.
My code looks like this:
class Vector:
x/float ::= ?
y/float ::= ?
…

Kasper Lund
- 82
- 10
0
votes
1 answer
What is the difference between := and ::= in Toit?
I'm writing code in Toit. In Toit programs, I can introduce fields and locals with either := or ::=.
main:
hello := "Hello"
log hello
world ::= "World"
log world
What is the difference?

Kasper Lund
- 82
- 10
0
votes
1 answer
How do I generate random numbers in Toit?
I'm writing code in Toit. How do I generate pseudo random numbers from a program written in Toit?
I am interested in generating integers in a specific range and floats in the half-open interval from 0 (included) to 1 (not included).

Kasper Lund
- 82
- 10
0
votes
1 answer
Did the device SDK update on my Toitbox just fail?
I am using Toitware's platform for IoT. I just lost connectivity between my Toitbox and the console. How can I know whether the SDK update has completed as expected?

Celine
- 18
- 7
-1
votes
1 answer
Toit.io ESP32 Connot change wifi password through device
I am trying to change password of device through code. It is giving this error. I have attached screenshot. Please help me.
Screenshot from toit.io console