Repository navigation
BASIC Functions
- ANALOGRD(pin)
- ASC(string)
- CHR$(num)
- COS(angle)
- INT(number)
- LEFT$(string,n)
- LEN(string)
- MID$(string,start,n)
- PINREAD(pin)
- RIGHT$(string,n)
- SIN(angle)
- STR$(number)
- TAN(angle)
- VAL(string)
Read analog value from pin.
PRINT ANALOGRD(15)
534
Read analog value from pin A1 (15 in Arduino Uno).
See analogRead() in Arduino Reference.
Returns ASCII code for first char in "string"
PRINT ASC("Hello")
72
If string is empty returns 0.
Returns a single character string, whose ASCII code is num
PRINT CHR$(33)
!
Return the cosine of angle. Angles are in degree.
PRINT COS(90)
0
Returns the integer part of a number.
PRINT INT(1.5)
1
Returns first n character from "string".
PRINT LEFT$("Hello!",3)
Hel
Return character count in "string":
PRINT LEN("HELLO!")
6
Returns n characters from "string" starting from start.
PRINT MID$("Hello!",3,2)
ll
Return logical value of an Arduino pin as number: 1 for high, 0 for low.
PRINT PINREAD(12)
1
See digitalRead() in Arduino Reference.
Returns last n characters from "string".
PRINT RIGHT$("Hello!",3)
lo!
Return the sine of angle. Angles are in degree.
PRINT SIN(90)
1
Convert number to string.
PRINT STR$(23)+"AA"
23AA
Returns tangent of angle. Anglres are in degree.
PRINT TAN(45)
1
Evaluate "string" as numeric expression and return result.
PRINT VAL("3*5-2")
13
You can use any numeric function in string.