<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Arduino Mega 2560 attached to Cetipede sheild</title><link>/products/arduino/b/blog/posts/arduino-mega-2560-attached-to-cetipede-sheild</link><description>I am trying to search for a code to couple the Centipede to the Arduino Mega2560, using the Cetipede 64 pin to work with a simple programme such as 1 input on the Mega and sequence of timings; int pin2 = 2;int pin3 = 3;int pin4 = 4;int pin5 = 5;...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Arduino Mega 2560 attached to Cetipede sheild</title><link>https://community.element14.com/products/arduino/b/blog/posts/arduino-mega-2560-attached-to-cetipede-sheild</link><pubDate>Wed, 29 Jan 2014 18:38:37 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a37d191a-c0a1-46ff-9cbf-1329180cf134</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;#include &amp;lt;Wire.h&amp;gt;&lt;br /&gt;#include &amp;lt;Centipede.h&amp;gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;/* Available commands&lt;br /&gt;&amp;nbsp; .digitalWrite([0...127], [LOW...HIGH]) - Acts like normal digitalWrite&lt;br /&gt;&amp;nbsp; .digitalRead([0...127]) - Acts like normal digitalRead&lt;br /&gt;&amp;nbsp; .pinMode([0...127], [INPUT...OUTPUT]) - Acts like normal pinMode&lt;br /&gt;&amp;nbsp; .portWrite([0...7], [0...65535]) - Writes 16-bit value to one port (chip)&lt;br /&gt;&amp;nbsp; .portRead([0...7]) - Reads 16-bit value from one port (chip)&lt;br /&gt;&amp;nbsp; .portMode([0...7], [0...65535]) - Write I/O mask to one port (chip)&lt;br /&gt;&amp;nbsp; .pinPullup([0...127], [LOW...HIGH]) - Sets pullup on input pin&lt;br /&gt;&amp;nbsp; .portPullup([0...7], [0...65535]) - Sets pullups on one port (chip)&lt;br /&gt;&amp;nbsp; .init() - Sets all registers to initial values&lt;br /&gt; &lt;br /&gt;&amp;nbsp; Examples&lt;br /&gt;&amp;nbsp; CS.init();&lt;br /&gt;&amp;nbsp; CS.pinMode(0,OUTPUT);&lt;br /&gt;&amp;nbsp; CS.digitalWrite(0, HIGH);&lt;br /&gt;&amp;nbsp; int recpin = CS.digitalRead(0);&lt;br /&gt;&amp;nbsp; CS.portMode(0, 0b0111111001111110); // 0 = output, 1 = input&lt;br /&gt;&amp;nbsp; CS.portWrite(0, 0b1000000110000001); // 0 = LOW, 1 = HIGH&lt;br /&gt;&amp;nbsp; int recport = CS.portRead(0);&lt;br /&gt;&amp;nbsp; CS.pinPullup(1,HIGH);&lt;br /&gt;&amp;nbsp; CS.portPullup(0, 0b0111111001111110); // 0 = no pullup, 1 = pullup&lt;br /&gt;*/&lt;br /&gt; &lt;br /&gt;Centipede CS; // create Centipede object&lt;br /&gt;int timer = 600;&lt;br /&gt;int pin6 = 6;&lt;br /&gt;int pin7 = 7;&lt;br /&gt;int pin0 = 0;&lt;/p&gt;&lt;p&gt;void setup()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; Wire.begin(); // start I2C&lt;br /&gt; &lt;br /&gt;&amp;nbsp; CS.initialize(); // set all registers to default&lt;br /&gt; CS.portMode(0, 0b0000000000000000);&lt;br /&gt; CS.portWrite(0, 0b1111111111111111);&lt;/p&gt;&lt;p&gt;&amp;nbsp; //TWBR = 12; // uncomment for 400KHz I2C (on 16MHz Arduinos)&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;void loop()&lt;br /&gt;{&amp;nbsp; &lt;br /&gt; CS.digitalWrite (pin7, HIGH);&lt;br /&gt; delay(timer);&lt;br /&gt; CS.digitalWrite (pin6, HIGH);&lt;br /&gt; delay(timer);&lt;br /&gt; CS.digitalWrite (pin0, HIGH);&lt;br /&gt; delay(timer);&lt;br /&gt; CS.digitalWrite (pin7, LOW);&lt;br /&gt; delay(timer);&lt;br /&gt; CS.digitalWrite (pin6, LOW);&lt;br /&gt; delay(timer);&lt;br /&gt; CS.digitalWrite (pin0, LOW);&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;My problem is to make it start when I want.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=17115&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Arduino Mega 2560 attached to Cetipede sheild</title><link>https://community.element14.com/products/arduino/b/blog/posts/arduino-mega-2560-attached-to-cetipede-sheild</link><pubDate>Tue, 28 Jan 2014 20:41:20 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a37d191a-c0a1-46ff-9cbf-1329180cf134</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Finally I solved part of the puzzle.&lt;/p&gt;&lt;p&gt;// Example code for Centipede Library&lt;/p&gt;&lt;p&gt;// Works with Centipede Shield or MCP23017 on Arduino I2C port&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;#include &amp;lt;Wire.h&amp;gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;Centipede.h&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;/* Available commands&lt;/p&gt;&lt;p&gt;&amp;nbsp; .digitalWrite([0...127], [LOW...HIGH]) - Acts like normal digitalWrite&lt;/p&gt;&lt;p&gt;&amp;nbsp; .digitalRead([0...127]) - Acts like normal digitalRead&lt;/p&gt;&lt;p&gt;&amp;nbsp; .pinMode([0...127], [INPUT...OUTPUT]) - Acts like normal pinMode&lt;/p&gt;&lt;p&gt;&amp;nbsp; .portWrite([0...7], [0...65535]) - Writes 16-bit value to one port (chip)&lt;/p&gt;&lt;p&gt;&amp;nbsp; .portRead([0...7]) - Reads 16-bit value from one port (chip)&lt;/p&gt;&lt;p&gt;&amp;nbsp; .portMode([0...7], [0...65535]) - Write I/O mask to one port (chip)&lt;/p&gt;&lt;p&gt;&amp;nbsp; .pinPullup([0...127], [LOW...HIGH]) - Sets pullup on input pin&lt;/p&gt;&lt;p&gt;&amp;nbsp; .portPullup([0...7], [0...65535]) - Sets pullups on one port (chip)&lt;/p&gt;&lt;p&gt;&amp;nbsp; .init() - Sets all registers to initial values&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; Examples&lt;/p&gt;&lt;p&gt;&amp;nbsp; CS.init();&lt;/p&gt;&lt;p&gt;&amp;nbsp; CS.pinMode(0,OUTPUT);&lt;/p&gt;&lt;p&gt;&amp;nbsp; CS.digitalWrite(0, HIGH);&lt;/p&gt;&lt;p&gt;&amp;nbsp; int recpin = CS.digitalRead(0);&lt;/p&gt;&lt;p&gt;&amp;nbsp; CS.portMode(0, 0b0111111001111110); // 0 = output, 1 = input&lt;/p&gt;&lt;p&gt;&amp;nbsp; CS.portWrite(0, 0b1000000110000001); // 0 = LOW, 1 = HIGH&lt;/p&gt;&lt;p&gt;&amp;nbsp; int recport = CS.portRead(0);&lt;/p&gt;&lt;p&gt;&amp;nbsp; CS.pinPullup(1,HIGH);&lt;/p&gt;&lt;p&gt;&amp;nbsp; CS.portPullup(0, 0b0111111001111110); // 0 = no pullup, 1 = pullup&lt;/p&gt;&lt;p&gt;*/&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Centipede CS; // create Centipede object&lt;/p&gt;&lt;p&gt;int pin7=7;&lt;/p&gt;&lt;p&gt;int pin6=6;&lt;/p&gt;&lt;p&gt;void setup()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; Wire.begin(); // start I2C&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; CS.initialize(); // set all registers to default&lt;/p&gt;&lt;p&gt; CS.portMode(0, 0b0000000000000000);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; //TWBR = 12; // uncomment for 400KHz I2C (on 16MHz Arduinos)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;void loop()&lt;/p&gt;&lt;p&gt;{&amp;nbsp; &lt;/p&gt;&lt;p&gt; CS.digitalWrite (pin7, HIGH);&lt;/p&gt;&lt;p&gt; CS.digitalWrite (pin6, HIGH);&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=17115&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Arduino Mega 2560 attached to Cetipede sheild</title><link>https://community.element14.com/products/arduino/b/blog/posts/arduino-mega-2560-attached-to-cetipede-sheild</link><pubDate>Tue, 28 Jan 2014 17:57:45 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a37d191a-c0a1-46ff-9cbf-1329180cf134</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;// Example code for Centipede Library&lt;br /&gt;// Works with Centipede Shield or MCP23017 on Arduino I2C port&lt;br /&gt; &lt;br /&gt;#include &amp;lt;Wire.h&amp;gt;&lt;br /&gt;#include &amp;lt;Centipede.h&amp;gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;/* Available commands&lt;br /&gt;&amp;nbsp; .digitalWrite([0...127], [LOW...HIGH]) - Acts like normal digitalWrite&lt;br /&gt;&amp;nbsp; .digitalRead([0...127]) - Acts like normal digitalRead&lt;br /&gt;&amp;nbsp; .pinMode([0...127], [INPUT...OUTPUT]) - Acts like normal pinMode&lt;br /&gt;&amp;nbsp; .portWrite([0...7], [0...65535]) - Writes 16-bit value to one port (chip)&lt;br /&gt;&amp;nbsp; .portRead([0...7]) - Reads 16-bit value from one port (chip)&lt;br /&gt;&amp;nbsp; .portMode([0...7], [0...65535]) - Write I/O mask to one port (chip)&lt;br /&gt;&amp;nbsp; .pinPullup([0...127], [LOW...HIGH]) - Sets pullup on input pin&lt;br /&gt;&amp;nbsp; .portPullup([0...7], [0...65535]) - Sets pullups on one port (chip)&lt;br /&gt;&amp;nbsp; .init() - Sets all registers to initial values&lt;br /&gt; &lt;br /&gt;&amp;nbsp; Examples&lt;br /&gt;&amp;nbsp; CS.init();&lt;br /&gt;&amp;nbsp; CS.pinMode(0,OUTPUT);&lt;br /&gt;&amp;nbsp; CS.digitalWrite(0, HIGH);&lt;br /&gt;&amp;nbsp; int recpin = CS.digitalRead(0);&lt;br /&gt;&amp;nbsp; CS.portMode(0, 0b0111111001111110); // 0 = output, 1 = input&lt;br /&gt;&amp;nbsp; CS.portWrite(0, 0b1000000110000001); // 0 = LOW, 1 = HIGH&lt;br /&gt;&amp;nbsp; int recport = CS.portRead(0);&lt;br /&gt;&amp;nbsp; CS.pinPullup(1,HIGH);&lt;br /&gt;&amp;nbsp; CS.portPullup(0, 0b0111111001111110); // 0 = no pullup, 1 = pullup&lt;br /&gt;*/&lt;br /&gt; &lt;br /&gt;Centipede CS; // create Centipede object&lt;br /&gt;int pin8=8;&lt;/p&gt;&lt;p&gt;void setup()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; Wire.begin(); // start I2C&lt;br /&gt; &lt;br /&gt;&amp;nbsp; CS.initialize(); // set all registers to default&lt;br /&gt; &lt;br /&gt;&amp;nbsp; CS.portMode(0, 0b0000000000000000); // set all pins on chip 0 to output&lt;br /&gt; &lt;br /&gt;&amp;nbsp; //TWBR = 12; // uncomment for 400KHz I2C (on 16MHz Arduinos)&lt;br /&gt; pinMode(pin8, OUTPUT);&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;void loop()&lt;br /&gt;{&amp;nbsp; &lt;br /&gt; CS.digitalWrite (pin8, HIGH);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I think something is missing, the i2c not specified, still confused?&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=17115&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Arduino Mega 2560 attached to Cetipede sheild</title><link>https://community.element14.com/products/arduino/b/blog/posts/arduino-mega-2560-attached-to-cetipede-sheild</link><pubDate>Tue, 28 Jan 2014 15:10:40 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a37d191a-c0a1-46ff-9cbf-1329180cf134</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;My problem is the Centipede shield, I am not sure what type of code to use.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=17115&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Arduino Mega 2560 attached to Cetipede sheild</title><link>https://community.element14.com/products/arduino/b/blog/posts/arduino-mega-2560-attached-to-cetipede-sheild</link><pubDate>Tue, 28 Jan 2014 11:36:30 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a37d191a-c0a1-46ff-9cbf-1329180cf134</guid><dc:creator>Workshopshed</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;You might find your code is a lot tidier and easier to manage if you use some arrays.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://arduino.cc/en/Tutorial/Array" rel="nofollow ugc noopener" target="_blank" title="http://arduino.cc/en/Tutorial/Array"&gt;Arduino - Array&lt;/a&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=17115&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>