I spent many hours to understand how to change ADC MCP3008 SPI communications into the ADC 0832CCN. I need to change this function:
//this works for ADC MCP 3008
Understanding SPI communications for diffrent ADC type in cpp implementation
//this works for ADC MCP 3008
Code (Text):
- double Mcp3008Spi::read( uint8_t channel , bool differential )
- {
- if( channel > 7 )
- {
- std::cerr << "Incorrect channel number (allowed 0-7)." << std::endl;
- return 0.0 / 0.0; // NaN
- }
- if( this->handle == -1 )
- return 0.0 / 0.0; // NaN
- uint8_t buffer[ 3 ];
- //...