MWX Library
latest_en
latest_en
  • The MWX Library
  • revision history
  • About the MWX library
    • License
    • Terms
    • The design policy
  • Install and Build
    • Environment (OS, etc.)
    • Installing the TWELITE SDK
    • Building ACT
    • Creating a new project
    • Installing VSCode
    • Build definition Makefile
    • Other platforms
  • Sample ACTs
    • act0 .. 4
    • Scratch
    • Slp_Wk_and_Tx
    • Parent_MONOSTICK
    • PingPong
    • BRD_APPTWELITE
    • BRD_I2C_TEMPHUMID
    • PAL_AMB
    • PAL_AMB-usenap
    • PAL_AMB-bhv
    • PAL_MAG
    • PAL_MOT-single
    • PAL_MOT-fifo
    • PulseCounter
    • WirelessUART
    • Rcv_Univsl
    • Unit_???
  • API
    • Definition.
    • class object
      • the_twelite
      • Analogue
      • Buttons
      • EEPROM
      • PulseCounter
      • Serial
      • SerialParser
      • SPI
        • SPI (using member functions)
        • SPI (using helper class)
      • TickTimer
      • Timer0 .. 4
      • Wire
        • Wire (using member functions))
        • Wire (using helper class)
    • Classes
      • MWX_APIRET
      • alloc
      • axis_xyzt
      • packet_rx
      • packet_tx
      • serparser
      • pktparser
        • E_PKT
        • idenify_packet_type()
        • TwePacket
          • TwePacketTwelite
          • TwePacketIO
          • TwePacketUART
          • TwePacketPAL
      • smplbuf
        • .get_stream_helper()
        • smplbuf_strm_u8
      • smplque
      • mwx::stream
        • format (mwx::mwx_format)
        • mwx::bigendian
        • mwx::crlf
        • mwx::flush
        • stream_helper
      • SM_SIMPLE state machine
    • Call back functions
      • setup()
      • begin()
      • loop()
      • wakeup()
      • init_coldboot()
      • init_warmboot()
      • on_rx_packet()
      • on_tx_comp()
    • BEHAVIOR
      • PAL_AMB-behavior
    • Functions
      • System Functions
        • millis()
        • delay()
        • delayMicroseconds()
        • random()
      • DIO General purpose IO
        • pinMode()
        • digitalWrite()
        • digitalRead()
        • attachIntDio()
        • detachIntDio()
        • digitalReadBitmap()
      • Utility Functions
        • Printf utils
        • pack_bits()
        • collect_bits()
        • Byte array utils
        • pack_bytes()
        • expand_bytes()
        • CRC8, XOR, LRC
        • div100()
        • Scale utils
        • pnew
    • External Libraries
      • EASTL
  • Board (BRD)
    • <BRD_APPTWELITE>
    • <MONOSTICK>
    • PAL
      • <PAL_AMB>
      • <PAL_MAG>
      • <PAL_MOT>
      • <PAL_NOTICE>
    • <CUE>
  • Sensor Devices (SNS)
    • SHTC3 - Temp/Humd sensor
    • SHT3x - Temp/Humd sensor
    • LTR-308ALS - Luminance Sensor
    • MC3630 - Accel sensor
    • BMx280 - Temp/Humd/Pressure Sensor
    • PCA9632 - LED Driver
  • Network (NWK)
    • Simple Relay Net <NWK_SIMPLE>
    • Layered Tree Net <NWK_LAYERED>
  • Settings (STG) - Interactive settings mode
    • <STG_STD>
GitBook提供
このページ内
  • Process flow
  • Procedures required for operation
  • Wire bus
  • Procedures when returning from sleep mode
  • Methods
  • get_luminance()
  • Common methods
  • setup()
  • begin(), end()
  • process_ev().
  • available()
  • probe()
PDFとしてエクスポート
  1. Sensor Devices (SNS)

LTR-308ALS - Luminance Sensor

LTR-308ALS - Illuminance sensor

Illuminance sensor using I2C bus.

Available only when the board BEHAVIOR <PAL_AMB> is loaded. Procedures of common methods except begin() are executed in board BEHAVIOR.

Process flow

  1. Wire.begin(): initialize bus 2..begin(): Start sensor operation 3.

  2. wait 50ms

  3. .available() becomes `true

  4. .get_luminance(): read value

Procedures required for operation

Wire bus

Before calling .begin() method, Wire should be put into operation by Wire.begin().

Procedures when returning from sleep mode

Keep the Wire bus in operation just before sleep (the Wire is automatically restored after returning from sleep).

Methods

get_luminance()

uint32_t get_luminance()

Returns an integer value of the illuminance [lx].

Returns -1 on error.

Common methods

setup()

void setup() 

Allocates and initializes a memory area for the sensor.

begin(), end()

void begin()
void end()

Starts acquiring a sensor. Wait about 50ms before reading the sensor value.

Does not support end().

process_ev().

void process_ev(uint32_t arg1, uint32_t arg2 = 0)

In the case of a sensor with a waiting process, give arg1 E_EVENT_TICK_TIMER or E_EVENT_START_UP to signal the passage of time. If the required time has elapsed after calling this method, it becomes available and the sensor value can be read.

available()

bool available()

Returns true when the sensor satisfies the read condition.

probe()

bool probe()

Return true when the sensor is connected.

前へSHT3x - Temp/Humd sensor次へMC3630 - Accel sensor

最終更新 2 年前