There still seem to be the same problem as with 1.6.5 where no particular sketch compiles and uploads and then adding a random line of code that compiles OK then triggers windows xp error reporting as soon as it tries to upload the sketch.
In this example, without the line "bool bFlag = false;" the sketch compiles and uploads just fine.
With the line "bool bFlag = false;" uncommented it compiles and then triggers windows xp error reporting.
Presumeably it is a problem with the the avr module.
I don't have this problem with version 1.0.6
// Install the LowPower library for optional sleeping support.
// See loop() function comments for details on usage.
//#include <LowPower.h>
#include <Wire.h>
#include <Adafruit_MCP23017.h>
CMCP23017 mcp;
uint8_t nArdLEDPin1 = 12, nArdLEDPin2 = 13;
bool bFlag = false;
void MCPInt1ISR()
{
digitalWrite(nArdLEDPin1, HIGH);
}
void MCPInt2ISR()
{
digitalWrite(nArdLEDPin2, HIGH);
}
void setup()
{
Serial.begin(115200);
//Serial.println("MCP23007 Interrupt Test");
mcp.begin(); // use default address 0
// We mirror INTA and INTB, so that only one line is required between MCP and Arduino for int reporting
// The INTA/B will not be Floating
// INTs will be signaled with a LOW
mcp.setupInterrupts(true, false, LOW);
// configuration for a button on port A
// interrupt will triger when the pin is taken to ground by a pushbutton
mcp.pinMode(0, INPUT);
mcp.pullUp(0, HIGH); // turn on a 100K pullup internally
mcp.setupInterruptPin(0, FALLING);
// similar, but on port B.
mcp.pinMode(1, INPUT);
mcp.pullUp(1, HIGH); // turn on a 100K pullup internall
mcp.setupInterruptPin(1, FALLING);
pinMode(nArdLEDPin1, OUTPUT);
pinMode(nArdLEDPin2, OUTPUT);
attachInterrupt(0, MCPInt1ISR, FALLING);
attachInterrupt(1, MCPInt2ISR, FALLING);
}
/**
* main routine: sleep the arduino, and wake up on Interrups.
* the LowPower library, or similar is required for sleeping, but sleep is simulated here.
* It is actually posible to get the MCP to draw only 1uA while in standby as the datasheet claims,
* however there is no stadndby mode. Its all down to seting up each pin in a way that current does not flow.
* and you can wait for interrupts while waiting.
*/
void loop()
{
delay(200);
digitalWrite(nArdLEDPin1, LOW);
digitalWrite(nArdLEDPin2, LOW);
}