LogoLogo
  • Hello!
  • The Device
    • Device basics
    • Plugging in a module
  • APP
    • Downloading the app
    • Before you start
    • Connecting to The Device
    • Setting a module
    • Using the IMU
    • Logging in / account
    • Checking battery power
    • Renaming the Device
    • Updating the firmware
    • Beacon
  • STARTER PROJECTS
    • Interactive Lighting
    • Touch-Free Music Remote
    • Air Quality Monitor
  • Equations
    • Getting started with equations
    • Equation logic
    • Inputs
    • Outputs
      • Keyboard mode
      • Glow Output & Lighting
        • Fade
        • Dot
        • Arc
        • Rainbow
        • Glitter
      • Cloud Output
    • Sequences
    • Casting an equation
    • Editing & deleting equations
    • Removing an equation
  • API
    • Languages
      • Javascript
      • Python CSV
    • Platforms
      • Unity
        • Windows
        • MacOS
      • TouchDesigner
      • Unreal Engine
    • Streaming
  • Modes
    • Beacon
  • Modules
    • Button
    • Color
    • Dial
    • Digital
    • Distance
    • Environment
    • Flex
    • Force
    • Gesture
    • Glow
    • Joystick
    • Light
    • Motion
    • Move
    • Proximity
    • Slider
    • Sound
    • Spin
    • Thermal
    • Tone
  • Algorithms
    • Orientation
Powered by GitBook
On this page
  • Properties
  • Code
  1. Modules

Proximity

Measures how close an object is to it.

PreviousMoveNextSlider

Last updated 1 year ago

Same module as gesture

NOTE: Only one proximity module can be used at a time

WARNING: Cannot be used at the same time as the color module

Properties

Name
Data Type
Range

Raw

int

0 - 255

Amount

int

0 - 100

What does the data mean?

100 means an object is within 2in to the sensor while 0 means there is no object within 1ft above it. While the distance module is good for long range, the proximity module is good for close range changes.

What ports can I use it on?

3-6

Code

var howClose = Magic.modules.proximity.amount;
using Magic;

public class Demo : MonoBehaviour
{
    // create a reference to the module
    public Magic.Modules.ProximityModule proximity;
    
    void Start()
    {
    }
    
    void Update()
    {
        // access the property of the module
        int howClose = proximity.amount;
    }
}