Почему я получаю ошибку Raspberry pi mcp3008 C++? ⇐ C++
-
Anonymous
Почему я получаю ошибку Raspberry pi mcp3008 C++?
I want to setup mcp3008 on raspberry pi 4. I took this code
#include #include #include int readMCP3008(int &channel); #define CHANNELS 4 #define SPI_CHANNEL 0 #define REFERENCE_VOLTAGE 5.0 int readMCP3008(int channel) { if (channel < 0 || channel >= CHANNELS) { fprintf(stderr, "Invalid channel.\n"); return -1; } unsigned char buffer[3]; buffer[0] = 0b11000000 | ((channel & 0x07)
Источник: https://stackoverflow.com/questions/780 ... 08-c-error
I want to setup mcp3008 on raspberry pi 4. I took this code
#include #include #include int readMCP3008(int &channel); #define CHANNELS 4 #define SPI_CHANNEL 0 #define REFERENCE_VOLTAGE 5.0 int readMCP3008(int channel) { if (channel < 0 || channel >= CHANNELS) { fprintf(stderr, "Invalid channel.\n"); return -1; } unsigned char buffer[3]; buffer[0] = 0b11000000 | ((channel & 0x07)
Источник: https://stackoverflow.com/questions/780 ... 08-c-error
Мобильная версия