<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: Arduino SensorBox firmware (with 4051 support!)</title>
		<atom:link href="http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/feed</link>
		<description></description>
		<pubDate>Tue, 18 Jun 2013 19:41:18 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-46556</guid>
					<title><![CDATA[Arduino SensorBox firmware (with 4051 support!)]]></title>
					<link>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-46556</link>
					<pubDate>Sat, 21 Nov 2009 01:16:50 +0000</pubDate>
					<dc:creator>Andrew Benson</dc:creator>

					<description>
						<![CDATA[
						<p>Hello,<br />
Having beat my head against the wall enough times with Firmata in educational environments, I put together a fairly simple Arduino firmware called SensorBox to just grab all the inputs, pack them up into a nice tidy bundle, and send them on to Max.  On the Max side, every effort was made to avoid special voodoo, file dependencies, or obfuscation.</p>
<p><a href="http://pixlpa.com/blog/arduino-sensorbox-firmware">http://pixlpa.com/blog/arduino-sensorbox-firmware</a></p>
<p>For those who need more than 6 analog inputs (who doesn&#8217;t?), I also made a configurable version that allows you to interface a 4051 8&#215;1 multiplexer chip to the analog pins, offering up to 96 possible inputs.  </p>
<p>have fun.</p>
<p>Andrew B.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167532</guid>
					<title><![CDATA[Re: Arduino SensorBox firmware (with 4051 support!)]]></title>
					<link>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167532</link>
					<pubDate>Tue, 08 Dec 2009 16:33:52 +0000</pubDate>
					<dc:creator>stefantiedje</dc:creator>

					<description>
						<![CDATA[
						<p>Is there some sort of schematic for how to connect the multiplexer? Sounds interesting&#8230;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167533</guid>
					<title><![CDATA[Re: Arduino SensorBox firmware (with 4051 support!)]]></title>
					<link>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167533</link>
					<pubDate>Tue, 08 Dec 2009 19:26:48 +0000</pubDate>
					<dc:creator>Patrick Delges</dc:creator>

					<description>
						<![CDATA[
						<p>Hi Stefan,</p>
<p>this may help you:</p>
<p><a href="http://www.arduino.cc/playground/Learning/4051" rel="nofollow">http://www.arduino.cc/playground/Learning/4051</a></p>
<p>p</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167534</guid>
					<title><![CDATA[Re: Arduino SensorBox firmware (with 4051 support!)]]></title>
					<link>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167534</link>
					<pubDate>Tue, 08 Dec 2009 20:42:16 +0000</pubDate>
					<dc:creator>Andrew Benson</dc:creator>

					<description>
						<![CDATA[
						<p>The link Patrick gave should get you going.  The 4051 chip is really easy to get connected, and just requires 3 I/0 pins. If you want to configure it to use multiple 4051 chips, you can control all of them with the same IO.</p>
<p>AB</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167535</guid>
					<title><![CDATA[Re: Arduino SensorBox firmware (with 4051 support!)]]></title>
					<link>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167535</link>
					<pubDate>Wed, 09 Dec 2009 15:59:01 +0000</pubDate>
					<dc:creator>Morgan</dc:creator>

					<description>
						<![CDATA[
						<p>Great! I&#8217;m going to use this in a project right now. Will be sure to report any problems/suggestions I have.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167536</guid>
					<title><![CDATA[Re: Arduino SensorBox firmware (with 4051 support!)]]></title>
					<link>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167536</link>
					<pubDate>Fri, 25 Jun 2010 09:42:46 +0000</pubDate>
					<dc:creator>nycpntr@yahoo.com</dc:creator>

					<description>
						<![CDATA[
						<p>this is hot like summer andrew. Got it workin in no time flat&#8230;.<br />
Keep up the great work,<br />
-M<br />
<a href="http://www.maxabeles.com" rel="nofollow">http://www.maxabeles.com</a><br />
(alot of Max/MSP work in my portfolio)</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167537</guid>
					<title><![CDATA[Re: Arduino SensorBox firmware (with 4051 support!)]]></title>
					<link>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167537</link>
					<pubDate>Mon, 18 Apr 2011 13:58:51 +0000</pubDate>
					<dc:creator>jasonD</dc:creator>

					<description>
						<![CDATA[
						<p>Hi Andrew, I think I was supposed to post here. Sorry about multiple posts &#8211; i cant delete the old one :-(</p>
<p>I am trying to hook up four 4051 multiplexers to use with your Sensorbox but wanted to check that I have the below code right, to get all four muxes in via the Arduino A0, A1, A2, A3 analog channels. Is this correct? Many thanks in advance.</p>
<p>//select analog channels to multiplex<br />
char is_muxPIN[6] = {1,1,1,1,0,0};//This is the only line of code I need to // change; for A0, A1, A2, A3 analog pins hosting four muxes<br />
char muxcount;//variable to store the number of multiplexed inputs</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167538</guid>
					<title><![CDATA[Re: Arduino SensorBox firmware (with 4051 support!)]]></title>
					<link>http://cycling74.com/forums/topic/arduino-sensorbox-firmware-with-4051-support/#post-167538</link>
					<pubDate>Sat, 25 Aug 2012 20:00:24 +0000</pubDate>
					<dc:creator>Rodrigo</dc:creator>

					<description>
						<![CDATA[
						<p>Is the data coming in supposed to only be 7bit? I&#8217;m only getting values from 0-127 on my first three analog ins and my second 3 inputs don&#8217;t move at all (constant reading of &#8217;43&#8242; or something in that range).</p>
<p>Also is there a way to use this with i2c analog ins?</p>
<p>After (literally) months of banging my head against a wall trying to get a consistent and fast connection going (the last approach was using call-response, which kept breaking) this seems to work bang on (much better than my other approaches), but I&#8217;m having a hard time adapting my code to this (or vice versa). </p>
<p>I&#8217;m rocking a 9DOF setup with 3axis accel (pins 0, 1, 2), 3axis gyro (pins 6, 7, 3) and 3axis magnetometer (i2c). No digital I/O (other than an onboard LED for troubleshooting purposes). </p>
<p>Here&#8217;s my attempted adaptation:</p>
<p>// i2c Arduino Library<br />
#include <wire .h> </wire></p>
<p>// 0011110b, i2c 7bit address of HMC5883<br />
#define address 0x1E </p>
<p>int AccX, AccY, AccZ, GyroX, GyroY, GyroZ, MagX, MagY, MagZ;<br />
char finish = 255;</p>
<p>#define aX A0<br />
#define aY A1<br />
#define aZ A2<br />
#define gX A6<br />
#define gY A7<br />
#define gZ A3<br />
#define LED1 5</p>
<p>void setup() {<br />
  //set LEDs as output pins<br />
  pinMode(LED1, OUTPUT);<br />
  pinMode(LED2, OUTPUT);</p>
<p>  // Start serial port at 57600 bps:<br />
  Serial.begin(57600);</p>
<p>  // Start i2c communication<br />
  Wire.begin();</p>
<p>  // Put the HMC5883 IC into the correct operating mode<br />
  Wire.beginTransmission(address); //open communication with HMC5883<br />
  Wire.write(0&#215;02); //select mode register<br />
  Wire.write(0&#215;00); //continuous measurement mode</p>
<p>  // Send a byte to establish contact until receiver responds<br />
  Wire.endTransmission();<br />
  while (establishContact()==0){delay(100);}  //wait for 99 byte</p>
<p>}</p>
<p>void loop() {<br />
  // Tell the HMC5883 where to begin reading data<br />
  Wire.beginTransmission(address);<br />
  Wire.write(0&#215;03); //select register 3, X MSB register<br />
  Wire.endTransmission();</p>
<p>    AccX = analogRead(aX);<br />
    AccY = analogRead(aY);<br />
    AccZ = analogRead(aZ);<br />
    GyroX = analogRead(gX);<br />
    GyroY = analogRead(gY);<br />
    GyroZ = analogRead(gZ);</p>
<p>  // Read data from each axis of magnetometer, 2 registers per axis<br />
  Wire.requestFrom(address, 6);<br />
  if(6< =Wire.available()){<br />
    MagX = Wire.read()< &lt;8; // X msb<br />
    MagX |= Wire.read(); // X lsb<br />
    MagZ = Wire.read()< &lt;8; // Z msb<br />
    MagZ |= Wire.read(); // Z lsb<br />
    MagY = Wire.read()< &lt;8; // Y msb<br />
    MagY |= Wire.read(); // Y lsb<br />
 // }</p>
<p>  // Send sensor data out<br />
  digitalWrite(LED1, HIGH);</p>
<p>  // Accelerometer X<br />
  Serial.write(highByte(AccX));<br />
  Serial.write(lowByte(AccX));</p>
<p>  // Accelerometer Y<br />
  Serial.write(highByte(AccY));<br />
  Serial.write(lowByte(AccY));</p>
<p>  // Accelerometer Z<br />
  Serial.write(highByte(AccZ));<br />
  Serial.write(lowByte(AccZ));</p>
<p>  // Gyroscope X<br />
  Serial.write(highByte(GyroX));<br />
  Serial.write(lowByte(GyroX));</p>
<p>  // Gyroscope Y<br />
  Serial.write(highByte(GyroY));<br />
  Serial.write(lowByte(GyroY));</p>
<p>  // Gyroscope Z<br />
  Serial.write(highByte(GyroZ));<br />
  Serial.write(lowByte(GyroZ));</p>
<p>  // Magnetometer X<br />
  Serial.write(highByte(MagX));<br />
  Serial.write(lowByte(MagX));</p>
<p>  // Magnetometer Y<br />
  Serial.write(highByte(MagY));<br />
  Serial.write(lowByte(MagY));</p>
<p>  // Magnetometer Z<br />
  Serial.write(highByte(MagZ));<br />
  Serial.write(lowByte(MagZ));</p>
<p>  Serial.write(finish);<br />
  Serial.write(finish);<br />
  digitalWrite(LED1,LOW);<br />
  delay(10);</p>
<p>  if(establishContact()==1) {<br />
    while(establishContact()==0) {delay(100);}//go into idle mode<br />
  }<br />
  }<br />
}</p>
<p>char establishContact(void){<br />
    if (Serial.available() > 0) {<br />
      char checkup = Serial.read();<br />
      if (checkup==99) return 1;<br />
      else return 0;<br />
    }<br />
    else return 0;<br />
}</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

