...
Code Block |
---|
#include <MCP3008.h> // define pin connections #define CS_PIN 12 #define CLOCK_PIN 9 #define MOSI_PIN 11 #define MISO_PIN 10 MCP3008 adc(CLOCK_PIN, MOSI_PIN, MISO_PIN, CS_PIN); void setup() { Serial.begin(9600); } void loop() { int val = adc.readADC(0); // read Chanel 0 from MCP3008 ADC Serial.println(val); } |
...
Reference
LibraryReference | URL |
---|---|
Wemos and MCP3008 example | http://www.esp8266learning.com/wemos-mcp3008-example.php |
Library by Uros Petrevski | https://github.com/nodesign/MCP3008 |
Library by Adafruit | https://github.com/adafruit/Adafruit_MCP3008 |
Reference
Reference | URL |
---|---|
Wemos and MCP3008 example | http://www.esp8266learning.com/wemos-mcp3008-example.php