+// This update May 2018 Peter Scargill
// So this is a relatively simple,cheap peripheral using a £1.50 NANO board from China.
// It is supported by my ESP8266 software but as it is an I2c slave you could run it
-// from anything able to handle I2c. For example I have found that some of the NanoPi units
+// from anything able to handle I2c. For example I have found that some of the NanoPi SBCs
// are not too keen on even a bright LED on their IO pins and from an operating
// system like Linux, getting PWM on several pins is just not on... so - plug in this device
// (default ID 9) with pullups (always needed for I2c) and you can gain PWM, ADC
-// and general IO for very little money.
+// and general IO for very little money or better, use with ESP-GO to add veryu inexpensive funtionality to the ESP8266.
// This version supports IR on pin 2 - you need this - follow installation instructions properly
// https://github.com/cyborg5/IRLib2
// Pin 2 is used for IR in using a standard 38khz type IR receiver. PWM not affected.
-// Note however the RETURN values have changed - now 6 bytes with the 5th being status.
+// Note the RETURN information - 6 bytes with the 5th being status.
// in the case of IR, 0,1,2,3 are 32 bit value, 4 is protocol. If protocol is zero, nothing there.
// 32 byte circular buffer.
-// if and when IR out is set up - this has to be pin 3.
-// So as a guide you could use 3,5,6 and 9, 10 and 11 for PWM (unless you use these pins for general IO)
-// you can use 2, 4, 7, 8, 12 and 13 as input/output (I tried using 0 and 1 - no go 0 flashes
-// on power up - 1 has pullup - best just avoid for GPIO 0 - use for serial IO).
+// if and when IR output is used - this has to be gpio pin 3.
+// As a guide you could use 3,5,6 and 9, 10 and 11 for PWM (unless you use these pins for general IO)
+// you can use 2, 4, 7, 8, 12 and 13 as input/output (I tried using 0 and 1 for GPIO - no go - 0 flashes
+// on power up - 1 has pullup - best just avoid using these two for general IO - use for serial IO).
// remember 13 probably has a LED attached on the board so best used for output.
-// You could use A0 (14), A1 (15), A2 (16) and A3 (17) as analog in - possibly
-// A6 (20) and A7 (21) if available. Set to 1.1v full scale.
+// You could use A0 (14), A1 (15), A2 (16) and A3 (17) as analog or digital inputs - possibly
+// A6 (20) and A7 (21) if available on your board. Set to 1.1v full scale.
// A4 and A5 are used for the I2c where A4 is SDA and A5 is SCL.
-// On the blog at https://tech.scargill.net you'll see several examples of using I2c from various boards.
+// On the blog at https://tech.scargill.net you'll see several examples of using I2c.
// Late addition - servos - any of the pins 2-13 can be a servo. command is 11 - so device, command, pin, value
// Send value 255 to disconnect a servo and note if ANY pin is set up as a servo you lose PWM options on pins 9 and 10.
// Just disconnect all individually to get the PWM back (normally all disconnected at power up).
// Values 0-180 but this varies with different servos. Mine buzzed at 0 !! See Arduino Servo library
-// A simple i2c SLAVE - default device number 9 - reads instructions from
+// The board becomes a simple i2c SLAVE - default (programmable) device number 9 - reads instructions from
// master and either sets outputs or returns inputs accordingly.
-// Not yet used but check out the enable interrupt library here
-// https://github.com/GreyGnome/EnableInterrupt
-// could be used for edge-triggered interrupts on any pin for pulse counting
-// There is also now a soft fade option for PWM, a tone generator and Dallas temperatur chip support for up to 2 chips.
+// There is also now a soft fade option for PWM, a tone generator and Dallas temperature chip support for up to 2 chips.
// Here I use a simplified version of my DS18B20 code from years back. This starts the conversion at the END
// of the code - so the first value is rubbish - read the blog as this is hidden - and there are no delays. On the assumption of one chip
// per pin, no need for search either!
-// This version returns 6 bytes - the LAST one is a status byte - 1 if busy. For IR bytes 0,1,2,3 are value, 4 is protocol. Simply send that out
+// This version returns 6 bytes - the LAST one is a status byte - 1 if busy. For IR, bytes 0,1,2,3 are value, 4 is protocol. Simply send that out
// for transmission... I'm using serial for debug right now - so can't use serial command - simply scrap that if you want to use serial out.