ロボカップジュニアサッカー IRM2121を用いた専用パルスボールを検知するためのライブラリ

Dependents:   BallCheck_IRM2121_InterrputInAdd CatPot_SensorRight

Embed: (wiki syntax)

« Back to documentation index

IRM2121 Class Reference

IRM2121 Class Reference

IRM2121 class, based on an InterruptIn pin, and a timer use RoboCup Junior Soccer to find PULSE BALL. More...

#include <IRM2121.h>

Public Member Functions

 IRM2121 (PinName IRM_PIN)
 Create a IRM2121 object connected to the specified InterruptIn pin.
void Set (void)
 Set a IRM2121 Interrupt Pin.
unsigned long Read (void)
 Read the result.
void ReturnVB (bool *valid, bool *busy)
 Check two flags( _Valid, _Busy )

Detailed Description

IRM2121 class, based on an InterruptIn pin, and a timer use RoboCup Junior Soccer to find PULSE BALL.

Example:

 // Set interrupt and read sensor.
 #include "mbed.h"
 #include "IRM2121.h"
 IRM2121 IR(p21);
 
 int main() {
     int length;
 
     while(1) {
  
        IR.Set();    
        wait_ms(20); //check _Busy 1 &_Valid 0 ....config just wait time.
        length = IR.Read();
     }
 }

Definition at line 31 of file IRM2121.h.


Constructor & Destructor Documentation

IRM2121 ( PinName  IRM_PIN )

Create a IRM2121 object connected to the specified InterruptIn pin.

Parameters:
IRM_PINInterruptIn pin to connect to

Definition at line 12 of file IRM2121.cpp.


Member Function Documentation

unsigned long Read ( void   )

Read the result.

Parameters:
none

Definition at line 53 of file IRM2121.cpp.

void ReturnVB ( bool *  valid,
bool *  busy 
)

Check two flags( _Valid, _Busy )

Parameters:
none

Definition at line 69 of file IRM2121.cpp.

void Set ( void   )

Set a IRM2121 Interrupt Pin.

Parameters:
none

Definition at line 42 of file IRM2121.cpp.