MD_Cubo LED Cube Arduino Library  2.1
Library to control LED Cubes
MD_Cubo_STC Class Reference
+ Inheritance diagram for MD_Cubo_STC:
+ Collaboration diagram for MD_Cubo_STC:

Public Member Functions

 MD_Cubo_STC (uint8_t tx, uint8_t rx, uint32_t bps)
 
void begin ()
 
void update ()
 
void setVoxel (uint32_t p, uint8_t x, uint8_t y, uint8_t z)
 
uint32_t getVoxel (uint8_t x, uint8_t y, uint8_t z)
 
void setVoxel (boolean p, uint8_t x, uint8_t y, uint8_t z)
 
void clear (uint32_t p=VOX_OFF)
 
uint8_t size (axis_t axis)
 
boolean isColorCube ()
 
- Public Member Functions inherited from MD_Cubo
 MD_Cubo (uint8_t sizeCube)
 
 ~MD_Cubo ()
 
virtual void setIntensity (uint8_t intensity)
 
uint8_t getIntensity (void)
 
virtual void animate (uint32_t wait=0)
 
uint8_t size (axis_t axis)
 
void fillPlane (uint32_t p, plane_t plane, uint8_t coord)
 
void copyPlane (plane_t plane, uint8_t cordFrom, uint8_t cordTo)
 
void drawLine (uint32_t p, uint8_t x1, uint8_t y1, uint8_t z1, uint8_t x2, uint8_t y2, uint8_t z2)
 
void drawRPrism (uint32_t p, uint8_t x, uint8_t y, uint8_t z, int8_t dx, int8_t dy, int8_t dz)
 
void drawCube (uint32_t p, uint8_t x, uint8_t y, uint8_t z, int8_t size)
 

Additional Inherited Members

- Public Types inherited from MD_Cubo
enum  axis_t : uint8_t { XAXIS, YAXIS, ZAXIS }
 
enum  plane_t : uint8_t { XYPLANE, XZPLANE, YZPLANE }
 
- Protected Attributes inherited from MD_Cubo
uint8_t _sizeXaxis
 the number of LEDs on x axis of the cube. Total number of voxels is x*y*z.
 
uint8_t _sizeYaxis
 the number of LEDs on y axis of the cube. Total number of voxels is x*y*z.
 
uint8_t _sizeZaxis
 the number of LEDs on z axis of the cube. Total number of voxels is x*y*z.
 
uint8_t _intensity
 the default intensity for the cube.
 

Member Function Documentation

◆ begin()

void MD_Cubo_STC::begin ( void  )
virtual

Initialize the object.

Initialize the object data. This needs to be called during setup() to initialize new data for the class that cannot be done during the object creation.

Hardware interfaces implemented in virtual functions should be initialized here.

Reimplemented from MD_Cubo.

◆ clear()

void MD_Cubo_STC::clear ( uint32_t  p = VOX_OFF)
virtual

Clear the cube.

Set every voxel in the cube to the specified value (default off). The generic method iterates through all the voxels. A more efficient implementation may be possible by exploiting access to hardware.

Parameters
pset the the RGB value required, RGB(0,0,0) for all black (default).
Returns
No return value.

Reimplemented from MD_Cubo.

◆ getVoxel()

uint32_t MD_Cubo_STC::getVoxel ( uint8_t  x,
uint8_t  y,
uint8_t  z 
)
virtual

Get the status of specified point in the cube.

This is the most basic graphic function and is necessarily only implementable in the user derived object, as it is heavily related to the hardware configuration. The (x,y,z) coordinate for the voxel needs to be mapped to a device address and color value of the voxel returned to the calling program.

Parameters
xx coordinate for the voxel.
yy coordinate for the voxel.
zz coordinate for the voxel.
Returns
voxel RGB value - VOX_OFF if the voxel is off. Otherwise the voxel color value.

Reimplemented from MD_Cubo.

◆ isColorCube()

boolean MD_Cubo_STC::isColorCube ( void  )
virtual

Return whether the cube supports RGB color.

Return true if the cube supports RGB colors. This will depend on the hardware implemented, so can be overridden by the user functions.

Returns
True if RGB color supported.

Reimplemented from MD_Cubo.

◆ setVoxel() [1/2]

void MD_Cubo_STC::setVoxel ( boolean  p,
uint8_t  x,
uint8_t  y,
uint8_t  z 
)
virtual

Set the specified point in the cube (monochrome version).

This method should only be implemented for monochrome cubes and is for backward compatibility only. The preferred implementation is to use the color version for all cubes.

This is the most basic graphic function and is necessarily only implementable in the user derived object, as it is heavily related to the hardware configuration. The (x,y,z) coordinate for the voxel needs to be mapped to a device action to turn the voxel on or off.

Parameters
pvoxel value - if false, set the voxel off. Otherwise, set the voxel on.
xx coordinate for the voxel.
yy coordinate for the voxel.
zz coordinate for the voxel.
Returns
No return value.

Reimplemented from MD_Cubo.

◆ setVoxel() [2/2]

void MD_Cubo_STC::setVoxel ( uint32_t  p,
uint8_t  x,
uint8_t  y,
uint8_t  z 
)
virtual

Set the specified point in the cube.

This is the most basic graphic function and is necessarily only implementable in the user derived object, as it is heavily related to the hardware configuration. The (x,y,z) coordinate for the voxel needs to be mapped to a device action to turn the voxel to the specified color in the specified color and intensity.

By default all cubes are treated as color cubes. User code should recognize if it is operating with a color or monochrome cube by testing isColorCube(). For clarity, monochrome cubes should use the default VOX_ON and VOX_OFF colors for clarity, color cubes are free to choose any RGB color.

Default for this virtual method is to invoke the monochrome method if color is not implemented in user code.

See also
isColorCube()
Parameters
pvoxel RGB value - if VOX_OFF, set the voxel off. Otherwise, set the voxel to the color.
xx coordinate for the voxel.
yy coordinate for the voxel.
zz coordinate for the voxel.
Returns
No return value.

Reimplemented from MD_Cubo.

◆ update()

void MD_Cubo_STC::update ( )
virtual

Update the cube display.

All cube changes are buffered internally until this method is called, at which time the cube is updated. This is only implementable in the user derived object, as it is heavily reliant on the hardware configuration.

Returns
No return value.

Reimplemented from MD_Cubo.


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