Makeblock-library-for-Arduino  V3.2.4
It's a library for arduino application developers
Public Member Functions | Protected Attributes | List of all members
MePort Class Reference

Port Mapping for RJ25. More...

#include <MePort.h>

Inheritance diagram for MePort:
Me4Button Me7SegmentDisplay MeBuzzer MeCompass MeDCMotor MeEncoderMotor MeFlameSensor MeGasSensor MeGyro MeHumiture MeJoystick MeLEDMatrix MeLightSensor MeLimitSwitch MeLineFollower MeOnBoardTemp MePIRMotionSensor MePotentiometer MeRGBLed MeSerial MeShutter MeSoundSensor MeStepper MeTemperature MeTouchSensor MeUltrasonicSensor MeUSBHost

Public Member Functions

 MePort (void)
 
 MePort (uint8_t port)
 
 MePort (uint8_t port, uint8_t slot)
 
uint8_t getPort (void)
 
uint8_t getSlot (void)
 
bool dRead1 (uint8_t mode=INPUT)
 
bool dRead2 (uint8_t mode=INPUT)
 
bool dpRead1 (void)
 
bool dpRead2 (void)
 
void dWrite1 (bool value)
 
void dWrite2 (bool value)
 
int16_t aRead1 (void)
 
int16_t aRead2 (void)
 
void aWrite1 (int16_t value)
 
void aWrite2 (int16_t value)
 
void reset (uint8_t port)
 
void reset (uint8_t port, uint8_t slot)
 
uint8_t pin1 (void)
 
uint8_t pin2 (void)
 
uint8_t pin (void)
 
uint8_t pin (uint8_t port, uint8_t slot)
 

Protected Attributes

uint8_t s1
 
uint8_t s2
 
uint8_t _port
 
uint8_t _slot
 

Detailed Description

Port Mapping for RJ25.

Class: MePort

Description
Declaration of Class MePort
Copyright (C), 2012-2016, MakeBlock

Constructor & Destructor Documentation

MePort::MePort ( void  )

Alternate Constructor which can call your own function to map the MePort to arduino port, no pins are used or initialized here

MePort::MePort ( uint8_t  port)

Alternate Constructor which can call your own function to map the MePort to arduino port, no pins are used or initialized here, but PWM frequency set to 976 Hz

Parameters
[in]port- RJ25 port from PORT_1 to M2
MePort::MePort ( uint8_t  port,
uint8_t  slot 
)

Alternate Constructor which can call your own function to map the MePort to arduino port, no pins are used or initialized here, but PWM frequency set to 976 Hz

Parameters
[in]port- RJ25 port from PORT_1 to M2
[in]slot- SLOT1 or SLOT2

Member Function Documentation

int16_t MePort::aRead1 ( void  )
Function
aRead1
Description
Read the analog value on slot1 of current RJ25 object's port
Output
None
Returns
Analog value from 0-1023
Others
None
int16_t MePort::aRead2 ( void  )
Function
aRead2
Description
Read the analog value on slot2 of current RJ25 object's port
Output
None
Returns
Analog value from 0-1023
Others
None
void MePort::aWrite1 ( int16_t  value)
Function
aWrite1
Description
Set the PWM output value on slot1 of current RJ25 object's port
Parameters
[in]value- Analog value between 0 to 255
Output
None
Returns
None
Others
None
void MePort::aWrite2 ( int16_t  value)
Function
aWrite2
Description
Set the PWM output value on slot2 of current RJ25 object's port
Parameters
[in]value- Analog value between 0 to 255
Output
None
Returns
None
Others
None
bool MePort::dpRead1 ( void  )
Function
dpRead1
Description
Read the digital input value on slot1 of current RJ25 object's port, the input mode set as INPUT_PULLUP.
Output
None
Returns
Digital input value
Others
None
bool MePort::dpRead2 ( void  )
Function
dpRead2
Description
Read the digital input value on slot2 of current RJ25 object's port, the input mode set as INPUT_PULLUP.
Output
None
Returns
Digital input value
Others
None
bool MePort::dRead1 ( uint8_t  mode = INPUT)
Function
dRead1
Description
Read the digital input value on slot1 of current RJ25 object's port
Parameters
[in]mode- digital input mode INPUT or INPUT_PULLUP
Output
None
Returns
Digital input value
Others
None
bool MePort::dRead2 ( uint8_t  mode = INPUT)
Function
dRead2
Description
Read the digital input value on slot2 of current RJ25 object's port
Parameters
[in]mode- digital input mode INPUT or INPUT_PULLUP
Output
None
Returns
Digital input value
Others
None
void MePort::dWrite1 ( bool  value)
Function
dWrite1
Description
Set the digital output value on slot1 of current RJ25 object's port
Parameters
[in]value- digital output value HIGH or LOW
Output
None
Returns
None
Others
None
void MePort::dWrite2 ( bool  value)
Function
dWrite2
Description
Set the digital output value on slot2 of current RJ25 object's port
Parameters
[in]value- digital output value HIGH or LOW
Output
None
Returns
None
Others
None
uint8_t MePort::getPort ( void  )
Function
getPort
Description
Get current valid port of current RJ25 object
Output
None
Returns
Port bumber from PORT_1 to M2
Others
None
uint8_t MePort::getSlot ( void  )
Function
getSlot
Description
Get current valid slot of current RJ25 object's port
Output
None
Returns
Slot bumber SLOT1 or SLOT2
Others
None
uint8_t MePort::pin ( void  )
Function
pin
Description
Return the arduino pin number of current RJ25 object's port, if the RJ25 module have one available PIN.
Output
None
Returns
The PIN number of arduino
Others
None
uint8_t MePort::pin ( uint8_t  port,
uint8_t  slot 
)
Function
pin
Description
Return the arduino pin number of current RJ25 object's port
Parameters
[in]port- RJ25 port from PORT_1 to M2
[in]slot- SLOT1 or SLOT2
Output
None
Returns
The PIN number of arduino
Others
None
uint8_t MePort::pin1 ( void  )
Function
pin1
Description
Return the arduino pin number of current RJ25 object's slot1
Output
None
Returns
The PIN number of arduino
Others
None
uint8_t MePort::pin2 ( void  )
Function
pin2
Description
Return the arduino pin number of current RJ25 object's slot2
Output
None
Returns
The PIN number of arduino
Others
None
void MePort::reset ( uint8_t  port)
Function
reset
Description
Reset the RJ25 available PIN by its port
Parameters
[in]port- RJ25 port from PORT_1 to M2
Output
None
Returns
None
Others
None
void MePort::reset ( uint8_t  port,
uint8_t  slot 
)
Function
reset
Description
Reset the RJ25 available PIN by its port and slot
Parameters
[in]port- RJ25 port from PORT_1 to M2
[in]slot- SLOT1 or SLOT2
Output
None
Returns
None
Others
None

Member Data Documentation

uint8_t MePort::_port
protected
Description
Variables used to store the port
uint8_t MePort::_slot
protected
Description
Variables used to store the slot
uint8_t MePort::s1
protected
Description
Variables used to store the slot1 gpio number
uint8_t MePort::s2
protected
Description
Variables used to store the slot2 gpio number

The documentation for this class was generated from the following files: