AYAB Arduino Firmware 0.95
The goal of the AYAB project is to provide an alternative way to control the famous Brother KH-9xx range of knitting machines using a computer
Solenoids Class Reference
Inheritance diagram for Solenoids:
Inheritance graph
Collaboration diagram for Solenoids:
Collaboration graph

Public Member Functions

void init () final
 Initialize I2C connection for solenoids.
 
void setSolenoid (uint8_t solenoid, bool state) final
 Set the state of a solenoid.
 
void setSolenoids (uint16_t state) final
 Set the state of all the solenoids.
 

Private Member Functions

void write (uint16_t state)
 

Private Attributes

uint16_t solenoidState = 0x0000U
 
Adafruit_MCP23008 mcp_0 = Adafruit_MCP23008()
 
Adafruit_MCP23008 mcp_1 = Adafruit_MCP23008()
 

Member Function Documentation

◆ init()

void Solenoids::init ( void  )
finalvirtual

Initialize I2C connection for solenoids.

Implements SolenoidsInterface.

References I2Caddr_sol1_8, and I2Caddr_sol9_16.

◆ setSolenoid()

void Solenoids::setSolenoid ( uint8_t  solenoid,
bool  state 
)
finalvirtual

Set the state of a solenoid.

Parameters
solenoidThe solenoid number to set (0 to 15).
stateThe state to set the solenoid to.

Implements SolenoidsInterface.

References write().

Here is the call graph for this function:

◆ setSolenoids()

void Solenoids::setSolenoids ( uint16_t  state)
finalvirtual

Set the state of all the solenoids.

Parameters
stateTwo bytes describing the state of the solenoids, one bit per solenoid.

Implements SolenoidsInterface.

References write().

Here is the call graph for this function:

◆ write()

void Solenoids::write ( uint16_t  newState)
private

Write to the I2C port expanders.

Low level function, mapping to actual wiring is done here.

Parameters
newStateTwo bytes describing the state of the solenoids, one bit per solenoid.
Here is the caller graph for this function:

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