Skip to main content
added 541 characters in body
Source Link
Michel Keijzers
  • 13k
  • 7
  • 42
  • 59

The setVoltage method has the following prototype:

void setVoltage( uint16_t output, bool writeEEPROM );

This means it does not return a value.

If you expect to return 1095, why not write:

volza = 1095;
setVoltage(volza, 1);
Serial.println(volza);

Some background information:

Assume you want to have the library a getVoltage method, than this is possible (you have to make a copy in your own project of the file and add the method. However, I'm not sure how easy it is to get the value from the EEPROM. If it is not easy, there is some programming work to do. Another solution is to store the value in memory, but that means some extra bytes from the scarce free SRAM. Also, in theory the content could be changed already (if another MCU would have access to the EEPROM too).

The setVoltage method has the following prototype:

void setVoltage( uint16_t output, bool writeEEPROM );

This means it does not return a value.

If you expect to return 1095, why not write:

volza = 1095;
setVoltage(volza, 1);
Serial.println(volza);

The setVoltage method has the following prototype:

void setVoltage( uint16_t output, bool writeEEPROM );

This means it does not return a value.

If you expect to return 1095, why not write:

volza = 1095;
setVoltage(volza, 1);
Serial.println(volza);

Some background information:

Assume you want to have the library a getVoltage method, than this is possible (you have to make a copy in your own project of the file and add the method. However, I'm not sure how easy it is to get the value from the EEPROM. If it is not easy, there is some programming work to do. Another solution is to store the value in memory, but that means some extra bytes from the scarce free SRAM. Also, in theory the content could be changed already (if another MCU would have access to the EEPROM too).

Source Link
Michel Keijzers
  • 13k
  • 7
  • 42
  • 59

The setVoltage method has the following prototype:

void setVoltage( uint16_t output, bool writeEEPROM );

This means it does not return a value.

If you expect to return 1095, why not write:

volza = 1095;
setVoltage(volza, 1);
Serial.println(volza);