PAW_Sensor: This library control the PAW sensor. This library get sensor values from the PAW sensor, and send these values to PC through serial-communication. And you need to convert these values to delta h using some module on PC. I create sample python module for this library. If you want to get this module, please access below page, https://github.com/HiroakiMatsuda/PAW-Sensor The PAW Sensor is developed by RT. If you need to get information about this sensors, please access below page. http://www.rt-shop.jp/index.php?main_page=product_info&cPath=42&products_id=1303

Dependents:   PAW_Sensor_HelloWorld

Embed: (wiki syntax)

« Back to documentation index

PAW Class Reference

PAW Class Reference

PAW_Sensor Library. More...

#include <paw.h>

Public Member Functions

 PAW (PinName led_1, PinName led_2, PinName photo_1, PinName photo_2)
 Create a PAW Sensor instance.
paw_value get_value ()
 Get values of PAW Sensor.
unsigned char process_paw ()
 Processing of Paw sensor.
bool get_state ()
 Get current processing-state.
void print (Serial *pc, unsigned char id)
 Send values of PAW Sensor through serial-communication.

Detailed Description

PAW_Sensor Library.

Example:

#include "mbed.h"
#include "paw.h"

Serial pc( USBTX, USBRX ); 
const unsigned long baudrate = 115200;

// paw( LED1, LED2, PHOTO1, PHOTO2 )
PAW paw( p8, p9, p16, p17 );
paw_value g_value;

Ticker run;


void run_paw_sensor()
{
    if( paw.process_paw() == STATE_1 )
    {
        paw.print( &pc, 0 );   
    }
}

int main() 
{
    // Initializing Serial Communication
    pc.baud( baudrate );
    pc.format( 8, Serial::None, 1 );
    
    run.attach_us(&run_paw_sensor, 500);
    
    while(1);
}

Definition at line 72 of file paw.h.


Constructor & Destructor Documentation

PAW ( PinName  led_1,
PinName  led_2,
PinName  photo_1,
PinName  photo_2 
)

Create a PAW Sensor instance.

Parameters:
led_1PAW Sensor's Pin 5
led_2PAW Sensor's Pin 4
photo_1PAW Sensor's Pin 3
photo_2PAW Sensor's Pin 2

Definition at line 3 of file paw.cpp.


Member Function Documentation

bool get_state (  )

Get current processing-state.

Returns:
Return current processing-state.

Definition at line 56 of file paw.cpp.

paw_value get_value (  )

Get values of PAW Sensor.

Returns:
Return values of photosensor's voltage.

Definition at line 51 of file paw.cpp.

void print ( Serial *  pc,
unsigned char  id 
)

Send values of PAW Sensor through serial-communication.

Parameters:
Referenceto serial object.
IDof PAW Sensor. you can chose number from 0 to 255.

Definition at line 61 of file paw.cpp.

unsigned char process_paw (  )

Processing of Paw sensor.

This fucntion must be performed periodically.

Returns:
Return current processing-state.

Definition at line 11 of file paw.cpp.