Uniot Docs
  • Introduction
  • Guides
    • Getting Started
    • Uniot Badge
    • Device Network
  • Foundations
    • Edge Logic Deployment
  • General Concepts
    • Primitives
    • Scripting
  • Platform
    • Dashboard
    • Sandbox
      • Visual Editor
        • Special
        • Logic
        • Math
        • Loops
        • Text
        • Variables
        • Functions
        • Primitives
      • Logger
      • Emulator
      • Control Panel
  • Advanced
    • Uniot Core
      • Scheduler
        • TaskScheduler
        • IExecutor
        • ISchedulerConnectionKit
        • Task
        • SchedulerTask
      • AppKit
        • AppKit
        • LispDevice
        • LispPrimitives
        • TopDevice
      • CBORWrapper
        • CBORObject
        • COSE
        • COSEMessage
        • ICOSESigner
      • Date
        • Date
        • SimpleNTP
      • EventBus
        • EventBus
        • IEventBusConnectionKit
        • DataChannels
        • EventEmitter
        • EventListener
        • EventEntity
        • CallbackEventListener
      • Hardware
        • Button
      • LispWrapper
        • DefaultPrimitives
        • LispHelper
        • PrimitiveExpeditor
        • unLisp
      • MQTTWrapper
        • CallbackMQTTDevice
        • MQTTDevice
        • MQTTKit
        • MQTTPath
      • Network
        • ConfigCaptivePortal
        • NetworkController
        • NetworkScheduler
      • Register
        • GpioRegister
        • ObjectRegister
        • ObjectRegisterRecord
        • Register
        • RegisterManager
        • RegisterManagerProxy
      • Storage
        • CBORStorage
        • CrashStorage
        • Storage
        • WifiStorage
      • Utils
        • Array
        • Bytes
        • ClearQueue
        • IterableQueue
        • LimitedQueue
        • GlobalBufferMemoryManager
        • Map
        • Singleton
        • TypeId
      • Credentials
    • Uniot Lisp
      • Language Description
      • Embedding Instructions
  • API
    • MQTT Convention
Powered by GitBook
On this page
  • value
  • math operation
  • arithmetic
  • number condition
  • remainder check
  1. Platform
  2. Sandbox
  3. Visual Editor

Math

PreviousLogicNextLoops

Last updated 2 months ago

The Math section provides a range of blocks that enable you to perform numerical operations and transformations within your script. Whether you are adding two values, generating random numbers, or applying advanced mathematical functions like trigonometry or square roots, these blocks help bring numeric logic and computation into your IoT projects.

Using these blocks, you can:

  • Perform basic arithmetic (addition, subtraction, multiplication, division).

  • Apply mathematical functions (absolute value, negotiation, checking value for compliance with different conditions).

  • Combine numeric operations with logic and loops to create complex, dynamic scripts.

value

Represents a fixed numeric value.

Parameters:

  • Input Value (Number): The numeric value to represent.

Example:

math operation

Performs operations like absolute value or negation.

Parameters:

  • Input Value (Number): The numeric value to operate on.

Example:

arithmetic

Performs basic arithmetic: add (+), subtract (-), multiply (*), divide (/).

Parameters:

  • Left Value (Number): The first numeric value.

  • Right Value (Number): The second numeric value.

Returns:

  • Number (Number): The result of the arithmetic operation.

Example:

number condition

Checks numeric properties: even, odd, positive, negative, divisible by.

Parameters:

  • Input Value (Number): The numeric value to check.

Returns:

  • Boolean (Boolean): True if the condition is met, false otherwise.

Example:

remainder check

Calculates the remainder after division.

Parameters:

  • Left Value (Number): The first numeric value.

  • Right Value (Number): The second numeric value.

Returns:

  • Number (Number): The remainder of the division.

Example:

Define temperature thresholds
Temperature difference calculation
Convert raw sensor value to voltage
Read sensor value every 5th script execution
Alternate on/off pattern for multiple LEDs