hi,
i've coded many things with led-output, but on the mc23017 expansion board
i cant getexamply work
here's code
// Blinks an LED attached to a MCP23XXX pin.
#include <Wire.h>
// ok to include only the one needed
// both included here to make things simple for example
//#include <Adafruit_MCP23X08.h>
#include <Adafruit_MCP23X17.h>
#define LED_PIN 0 // MCP23XXX pin LED is attached to
// only used for SPI
//#define CS_PIN 6
// uncomment appropriate line
//Adafruit_MCP23X08 mcp;
Adafruit_MCP23X17 mcp;
void setup() {
Serial.begin(9600);
//while (!Serial);
Serial.println("MCP23xxx Blink Test!");
// uncomment appropriate mcp.begin
if (!mcp.begin_I2C()) {
//if (!mcp.begin_SPI(CS_PIN)) {
Serial.println("Error.");
//while (1);
}
// configure pin for output
mcp.pinMode(LED_PIN, OUTPUT);
//Serial.println("Looping...");
Serial.println("Setup ready");
}
void loop() {
mcp.digitalWrite(LED_PIN, HIGH);
delay(500);
mcp.digitalWrite(LED_PIN, LOW);
delay(500);
Serial.println("loopy");
delay(1500);
}
this code comes with the lib, in few lines adaption to my conditions on arduino nano
the serial output works just ok,
but i cant get led to blink, what was the easiest step on other situations.
i have tested with different pins, same result..
As i use an expansion board, i dont not know whether there are special things necessary,
documentation does not tell..
does anyone has experience with that ?