<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Arduino with Gen 6 board</title>
        <description>Hi,

I have assembled Mendel (3D printer) using Generation 6 electronics board that has ATMega644A incorporated on it.
I need to use an Arduino Uno board to get these two boards to communicate and currently I am a bit baffled by the I2C communication.
Can anyone help me with this. I am pretty new to all this stuff.</description>
        <link>https://reprap.org/forum/read.php?218,90583,90583#msg-90583</link>
        <lastBuildDate>Sun, 19 Apr 2026 16:33:04 -0400</lastBuildDate>
        <generator>Phorum 5.2.23</generator>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,96337#msg-96337</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,96337#msg-96337</link>
            <description><![CDATA[ I thought, first I should turn the led ON and OFF with the existing codes; G1 (ON) and G28 (OFF).<br />
<br />
I put this is Reprap.<br />
<pre class="bbcode">
#include 

#define reprap 6
#define slave 5

void setup ()
 {
 Wire.begin (reprap);
 }
 
void loop()
{
  Wire.beginTransmission (slave);
  Wire.send ("G1"); 
  Wire.endTransmission();
  
  Wire.beginTransmission (slave);
  Wire.send ("G28");
  Wire.endTransmission();
}</pre>
<br />
And this in Arduino.<br />
<pre class="bbcode">
#include 

#define slave 5
#define LED 13

void receiveEvent (int howMany)
 {
  char buf [10];
  byte i = 0;

  while (Wire.available () &gt; 0)
    {
    char c = Wire.receive ();
    if (i &lt; sizeof (buf) - 1)  // check for overflow
      buf [i++] = c;
    }  // end of while

   buf <i> = 0;  // terminating null
   
  if (memcmp (buf, "G1", 2) == 0)
    digitalWrite (LED, HIGH);
  else if (memcmp (buf, "G28", 3) == 0)
    digitalWrite (LED, LOW);
}  // end of receiveEvent


void setup () 
{
  Wire.begin (slave);
  Wire.onReceive (receiveEvent);
  pinMode (LED, OUTPUT);
}  // end of setup

void loop() 
{
// nothing in main loop
}
</i></pre>
This is the code that compares any string starting with G1 or G28 with the incoming data.<br />
But the problem is that the LED remains ON and when I send G1 or G28, it turns OFF. It does flicker very quickly on execution of each command but still not turning ON when it receives G1 and OFF on G28. Just have a look and see if you can figure it out.]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Thu, 01 Sep 2011 15:16:24 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,95816#msg-95816</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,95816#msg-95816</link>
            <description><![CDATA[ Yes, the e-mail system is not so great here at this forum.<br />
<br />
Anyways, I was just working through the code when I thought of introducing some new g codes, G100 &amp; G101. So that I write g code in repsnapper in this format:<br />
G100 <br />
G1 X10 Y10 (for this command, I will get 1 at output, LED on)<br />
G101<br />
G1 X15 Y15 (for this command, I will get 0 at output, LED off)<br />
<br />
I thought it would be a good idea, without disturbing any of the Reprap code but I can't seem to send the signal from Reprap to Arduino. When I upload what I have posted, the LED remains OFF, like it is not receiving anything. Have a look at the code and I am pretty sure that you will find a lot of mistakes (because it is not working and also because I did the coding :P)<br />
<br />
And thanks a lot for helping me out :)]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Sun, 28 Aug 2011 19:24:54 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,95813#msg-95813</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,95813#msg-95813</link>
            <description><![CDATA[ .]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Sun, 28 Aug 2011 19:16:55 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,95801#msg-95801</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,95801#msg-95801</link>
            <description><![CDATA[ Sorry I haven't posted in a while, I somehow didn't realise you had made more posts. (the email system in this forum seems unreliable) I will go through what I've "missed" and write another post tomorrow.]]></description>
            <dc:creator>danieljabailey</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Sun, 28 Aug 2011 18:06:54 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,95333#msg-95333</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,95333#msg-95333</link>
            <description><![CDATA[ I have come up with a different idea. I'll just walk you through that.<br />
<br />
I have introduced some new G Codes in process_g_code file after line 605 (case 92)<br />
<pre class="bbcode">
                       case 100: 
                               Wire.beginTransmission (5);
                               Wire.send ("G100"); 
                               Wire.endTransmission();
				break;

                        case 101: 
                               Wire.beginTransmission (5);
                               Wire.send ("G101"); 
                               Wire.endTransmission();
				break;</pre>
<br />
After this, I changed the code in the Gen 6 board in order to send G Code from it to Arduino.<br />
This was initially in Gen 6<br />
<pre class="bbcode">
void receiveEvent(int howMany)
{

}

void requestEvent()
{
  Wire.send("start");
}</pre>
I changed it to<br />
<pre class="bbcode">
//i2c address of the gen 6
int REP_RAP_ADDR = 4;
//my address
int CP_ADDR = 5;
void setup()
{  
  Wire.begin(4);
}
void loop()
{
 
}</pre>
<br />
So that I can send G Codes from Gen 6 to Arduino. And now Arduino has this code.<br />
<pre class="bbcode">
#include "Wire.h"

//i2c address of the gen 6
int REP_RAP_ADDR = 4;
//my address
int CP_ADDR = 5;
int ledPin = 2;

void setup()
{
  Wire.begin(CP_ADDR);
  Wire.onReceive(receiveEvent); // register event so that anything received on i2c is sent to the serial 
  pinMode(ledPin, OUTPUT);  
}

void receiveEvent(int howMany)
{
  char incoming[128]; // Set this to the maximum expected string length +1 for a null char 
  char length;
  while(0 &lt; Wire.available()) // loop through all
   {
     delay(100); 
    length = Wire.available();
    for (int i = 0; i &lt; length; i++) {
        if(i &gt; 128){                       //prevent data corruption in case you accidentally receive more than the array can hold
            incoming[128] = '\0';  //put a null char at the end of the array
            break;
        } 
        incoming<i> = Wire.receive();
        }
    }
    char str1[] = "G100";
 char str2[] = "G101"; 
  
  if (strcmp(str1, incoming) == 0){
      //turn dispenser on
      digitalWrite(2, HIGH); }
    
    if (strcmp(str2, incoming) == 0) {    
      //turn dispenser off
      digitalWrite(2, LOW);}
}

</i></pre>
In the Arduino, first I am storing anything that comes via I2C in a string and then I am comparing it to G100 and G101.<br />
<br />
This is just something that I come up with but right now it seems that the LED is not receiving anything because it remains OFF no matter what I send. I think the problem is in the code of Gen 6. May be Arduino as well, I really don't know.<br />
<br />
Kindly have a look at this and let me know.]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Wed, 24 Aug 2011 17:14:15 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,95175#msg-95175</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,95175#msg-95175</link>
            <description><![CDATA[ I am just asking to confirm as you didn't reply to this post. I have this code in the Arduino now. I am a bit curious about the void setup (don't know why:S)<br />
<pre class="bbcode">
#include "Wire.h"

//i2c address of the gen 6
int REP_RAP_ADDR = 4;
//my address
int CP_ADDR = 5;
int ledPin = 2;                 // LED connected to digital pin 2

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  Wire.begin(CP_ADDR);
  Wire.onReceive(receiveEvent); // register event so that anything received on i2c is sent to the serial
//Test gcode, this should send the machine's X, Y and Z to home
  sendGCode("G28 X0 Y0 Z0\n");
}

void receiveEvent(int howMany)
{
  while(0 &lt; Wire.available()) // loop through all
  {
    char c = Wire.receive(); // receive byte as a character
    if (c = '1') 
    {
      //turn dispenser on
      digitalWrite(2, HIGH); //replace the number 2 with the dispenser pin number
    }
    if (c = '0') 
    {
      //turn dispenser off
      digitalWrite(2, LOW);
    }
  }
}

void sendGCode(char* GCode)
{
  Wire.beginTransmission(REP_RAP_ADDR);
  Wire.send(GCode);
  Wire.endTransmission();   
}

void loop()
{
  
}</pre>
<br />
Is this fine?<br />
<br />
I also made changes to the main code as suggested and someone else has also mentioned the same place to make changes. Although the comment was find where e is 0 and where e&gt;0. This is where e &gt; 0. From line 275-291.<br />
<pre class="bbcode">
if (e_can_step)
		{
			dda_counter.e += delta_steps.e;
			
			if (dda_counter.e &gt; 0)
			{
                                
				do_e_step();
                                real_move = true;
				dda_counter.e -= total_steps;
				
				if (e_direction)
					current_steps.e++;
				else
					current_steps.e--;
			}
		}</pre>
<br />
This is when e is 0. Line 33 in cartesian_dda.pde file.<br />
<pre class="bbcode">
// Default to the origin and not going anywhere
  
	target_position.x = 0.0;
	target_position.y = 0.0;
	target_position.z = 0.0;
	target_position.e = 0.0;
        target_position.f = SLOW_XY_FEEDRATE;</pre>
So you were absolutely correct.<br />
But by following what you suggested before, the LED remains OFF.  It doesn't turn ON even for a second.<br />
I am sending custom g codes to Repsnapper with E1 and E0 to check whether it turns ON and OFF but to no avail.<br />
Just asking to confirm, is the setup not correct?<br />
<br />
And is this new information any useful about when e is at 0? How can it be used to achieve the objective?]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Tue, 23 Aug 2011 17:57:34 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,95069#msg-95069</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,95069#msg-95069</link>
            <description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />
This is the method to use if you want to give the gen 6 the ability to control the speed of the dispenser and it will need modification of the gen 6 code</div></blockquote>
Will it be easy to do:S<br />
<br />
The DAC is 12 bit (MCP 4921).<br />
Here is the link. <br />
<pre class="bbcode">
[<a href="http://ww1.microchip.com/downloads/en/devicedoc/21897a.pdf" target="_blank"  rel="nofollow">ww1.microchip.com</a>]</pre>
<br />
By using this method, will I be able to print out anything with Repsnapper in the conventional way or not ?]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Tue, 23 Aug 2011 09:31:51 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,95017#msg-95017</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,95017#msg-95017</link>
            <description><![CDATA[ Javaid Butt Wrote:<br />
-------------------------------------------------------<br />
&gt; I will work on that part but in the meantime,<br />
&gt; let's work out the second method. May be it will<br />
&gt; prove to be viable.<br />
&gt; <br />
&gt; Another option (although probably not the best for<br />
&gt; this application it would still be an effective<br />
&gt; and viable solution) is to develop a small<br />
&gt; protocol to give the gen 6 direct access to the<br />
&gt; arduino's pins (it's simpler than it sounds), each<br />
&gt; byte sent via i2c could contain a pin number in<br />
&gt; the lowest 4 bits, its state in the fifth and its<br />
&gt; mode in the sixth and then perhaps for efficiency<br />
&gt; the seventh bit could be to determine if the pin<br />
&gt; mode needs changing, that leaves one bit spare if<br />
&gt; you need it and therefore could be used to<br />
&gt; indicate that the next byte is to set an analog<br />
&gt; value (or the next two bytes if it is a high res<br />
&gt; DAC like yours), this would simplify the job that<br />
&gt; the arduino does and give full control to the gen<br />
&gt; 6, this would make switching on digital output 4<br />
&gt; on the arduino from the gen 6 as simple as sending<br />
&gt; B00010100 down the i2c line and make setting an<br />
&gt; analog value as simple as sending these three:<br />
&gt; B10000000 B00111111 B11111111 (this example would<br />
&gt; set the 14 bit analog output to its maximum<br />
&gt; output) this would just turn the arduino into a<br />
&gt; simple i2c IO expander<br />
&gt; <br />
&gt; How to implement this and please tell me there is<br />
&gt; no need to change anything in the Gen 6 code for<br />
&gt; this method......<br />
<br />
This is the method to use if you want to give the gen 6 the ability to control the speed of the dispenser and it will need modification of the gen 6 code<br />
<br />
To show you how to code this I would need to know the resolution of your DAC. (Was it fourteen bits?)]]></description>
            <dc:creator>danieljabailey</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Tue, 23 Aug 2011 03:44:53 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,94981#msg-94981</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,94981#msg-94981</link>
            <description><![CDATA[ I will work on that part but in the meantime, let's work out the second method. May be it will prove to be viable.<br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />
Another option (although probably not the best for this application it would still be an effective and viable solution) is to develop a small protocol to give the gen 6 direct access to the arduino's pins (it's simpler than it sounds), each byte sent via i2c could contain a pin number in the lowest 4 bits, its state in the fifth and its mode in the sixth and then perhaps for efficiency the seventh bit could be to determine if the pin mode needs changing, that leaves one bit spare if you need it and therefore could be used to indicate that the next byte is to set an analog value (or the next two bytes if it is a high res DAC like yours), this would simplify the job that the arduino does and give full control to the gen 6, this would make switching on digital output 4 on the arduino from the gen 6 as simple as sending B00010100 down the i2c line and make setting an analog value as simple as sending these three: B10000000 B00111111 B11111111 (this example would set the 14 bit analog output to its maximum output) this would just turn the arduino into a simple i2c IO expander</div></blockquote>
How to implement this and please tell me there is no need to change anything in the Gen 6 code for this method......]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Mon, 22 Aug 2011 17:16:11 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,94975#msg-94975</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,94975#msg-94975</link>
            <description><![CDATA[ As far as I know, the Enable pin is often on even when the extruder isn't moving and when the the printer isn't printing. This is not to mention that it doesn't have a proper pin to connect a wire, it would be difficult soldering a wire on to it.<br />
<br />
It would make more sense to find the code that sets this pin high and add code to it to tell the arduino than read it with an arduino input.<br />
<br />
What would be an even better idea is find the code that steps the motor and use that to tell the arduino to dispense.<br />
<br />
I am not the person to ask about where the code to make a movement starts and stops and therefore I don't know where to put the code to issue the start dispensing and stop dispensing commands, try asking in a forum board for firmware, try here: <a href="http://forums.reprap.org/list.php?146" target="_blank"  rel="nofollow">http://forums.reprap.org/list.php?146</a>]]></description>
            <dc:creator>danieljabailey</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Mon, 22 Aug 2011 11:18:23 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,94952#msg-94952</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,94952#msg-94952</link>
            <description><![CDATA[ Wouldn't it be simpler if we can send a signal from reprap to arduino whenever reprap starts printing. <br />
<br />
In the Gen 6 circuit diagram, the EXTR EN pin on the atmega is 43 and then the motor driver enable pin is 26 (IC8 just on the bottom right of atmega). <br />
Correct me if I am wrong about the pins. Can we make use of the signal coming here. I checked with multimeter whenever "E" has a value, there is some voltage on the pins of the Gen 6 where extruder is connected. What do you think ?<br />
<br />
[attachment 5099 GEN6_Mendel_Circuit.pdf]]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Mon, 22 Aug 2011 07:39:25 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,94929#msg-94929</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,94929#msg-94929</link>
            <description><![CDATA[ All right, now this is the code in Arduino. I connected the LED to pin 2 in order to avoid confusion with reprap.<br />
<pre class="bbcode">
#include "Wire.h"

//i2c address of the gen 6
int REP_RAP_ADDR = 4;
//my address
int CP_ADDR = 5;
int ledPin = 2;                 // LED connected to digital pin 2

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  Wire.begin(CP_ADDR);
  Wire.onReceive(receiveEvent); // register event so that anything received on i2c is sent to the serial
//Test gcode, this should send the machine's X, Y and Z to home
  sendGCode("G28 X0 Y0 Z0\n");
}

void receiveEvent(int howMany)
{
  while(0 &lt; Wire.available()) // loop through all
  {
    char c = Wire.receive(); // receive byte as a character
    if (c = '1') 
    {
      //turn dispenser on
      digitalWrite(2, HIGH); //replace the number 2 with the dispenser pin number
    }
    if (c = '0') 
    {
      //turn dispenser off
      digitalWrite(2, LOW);
    }
  }
}

void sendGCode(char* GCode)
{
  Wire.beginTransmission(REP_RAP_ADDR);
  Wire.send(GCode);
  Wire.endTransmission();   
}

void loop()
{
  
}</pre>
<br />
I also made changes to the main code in reprap but the thing is that the LED is continuously OFF :S]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Mon, 22 Aug 2011 03:32:13 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,94667#msg-94667</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,94667#msg-94667</link>
            <description><![CDATA[ I forgot to mention that you will need to turn acceleration off as you don't have any speed control.<br />
<br />
You can do this by commenting out lines 9 - 11 in cartesian_dda.pde<br />
<br />
to go from this...<br />
<br />
<pre class="bbcode">
#ifndef ACCELERATION_ON
  #define ACCELERATION_ON
#endif</pre>
<br />
to this...<br />
<br />
<pre class="bbcode">
//#ifndef ACCELERATION_ON
//  #define ACCELERATION_ON
//#endif
</pre>]]></description>
            <dc:creator>danieljabailey</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Fri, 19 Aug 2011 13:05:15 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,94665#msg-94665</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,94665#msg-94665</link>
            <description><![CDATA[ To implement this system all you need to do is to add some code to the <b>Arduino UNO</b> and then add code that commands the arduino uno into the appropriate GCode parsing code in the <b>gen 6</b>,<br />
<br />
So the computer will tell the gen6 what to do, the gen6 will turn the E codes (extruder codes which are delivered along with G1 codes) into commands for the arduino uno, the uno will then turn the dispenser on or off.<br />
<br />
So in the arduino you need to change this code...<br />
<pre class="bbcode">
void receiveEvent(int howMany)
{
  while(0 &lt; Wire.available()) // loop through all
  {
    char c = Wire.receive(); // receive byte as a character
    Serial.print(c);         // print the character       
  }
}</pre>
<br />
So that it is now...<br />
<br />
<pre class="bbcode">
void receiveEvent(int howMany)
{
  while(0 &lt; Wire.available()) // loop through all
  {
    char c = Wire.receive(); // receive byte as a character
    if (c = '1') 
    {
      //turn dispenser on
      digitalWrite(4, HIGH); //replace the number 4 with the dispenser pin number (if it isn't 4, or better yet, define a constant)
    }
    if (c = '0') 
    {
      //turn dispenser off
      digitalWrite(4, LOW);
    }
  }
}</pre>
<br />
and don't forget to set the pin mode to output first.<br />
<br />
I haven't tested the next bit and I don't know if this is the correct place to be doing this but it's my best bet, lines 279 - 290 in cartesian_dda.pde need to change from this...<br />
<br />
<pre class="bbcode">
if (dda_counter.e &gt; 0)
			{
                                
				do_e_step();
                                real_move = true;
				dda_counter.e -= total_steps;
				
				if (e_direction)
					current_steps.e++;
				else
					current_steps.e--;
			}</pre>
<br />
To this...<br />
<br />
<pre class="bbcode">
if (dda_counter.e &gt; 0)
			{
                                Wire.send('1'); //tell the arduino to dispense powder
				do_e_step();
                                real_move = true;
				dda_counter.e -= total_steps;
				
				if (e_direction)
					current_steps.e++;
				else
					current_steps.e--;
			} else {Wire.send('0');} //tell the arduino to stop</pre>
<br />
As I say this is just a guess, I don't know my way around the FiveD code very well, it is probably a better idea to ask for someone that does to help with this bit if my suggestion will not work. (It may end up continuously dispensing and not stopping)]]></description>
            <dc:creator>danieljabailey</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Fri, 19 Aug 2011 13:01:27 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,94621#msg-94621</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,94621#msg-94621</link>
            <description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />
I am guessing that you wanted to say that a digital signal can have one of two possible states, 1 or 0 (on or off) and that the digital signal for pin 4 is to switch the powder dispenser on or off, let me know if this is wrong</div></blockquote>
<br />
Absolutely correct.<br />
<br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />
....when you say "the printer", do you refer only to the machine and it's gen 6 or the entire system including your arduino?</div></blockquote>
<br />
I was referring to the Gen 6 board and the machine. Arduino was not a part of it.<br />
<br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />
the easiest way to do this is to use a simple command system, so for example you could make the arduino interpret the character '1' as "Turn on the dispenser" (in the receive event in the arduino you just need a simple if statement to do this) then when you want the gen6 to turn it on simply send the arduino the character '1', similarly, you can make '0' be the command to turn it off. This system isn't great if you need lots of different values on the DAC as there could only be 256 unique commands (8 bit binary, 0 to 255).</div></blockquote>
<br />
This method looks simple enough. Let's try out this one first.<br />
I have a confusion here, let's say that the "simple command system" has been implemented. A variable will be declared to achieve this (right!). Now, Gen6 is operated by Repsnapper and if I am trying to print out something say 4 dots in a row, will I be able to send my own g code to repsnapper like,<br />
G1 X5 B1                      (B is the 1 and 0 state variable, so here the dispenser will dispense)<br />
G1 X10 B0                     (In this period, it will not dispense)<br />
G1X15 B1                       (dispensing)<br />
<br />
Correct me if I am wrong in this interpretation :S<br />
<br />
For the analogue signal, I will be running it at a constant value, say 4V for a particular dispensing period. And if I want to dispense less powder, I will change the value in the Arduino and run it again at say 2V. For the moment, let's not worry about this one.]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Fri, 19 Aug 2011 08:17:23 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,94606#msg-94606</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,94606#msg-94606</link>
            <description><![CDATA[ Javaid Butt Wrote:<br />
-------------------------------------------------------<br />
&gt; All right. Here goes:<br />
&gt; 1- 3D Printer has been assembled and it is<br />
&gt; communicating with Arduino via I2C.<br />
&gt; 2- I need to connect a dry powder dispensing<br />
&gt; device to the printer. It needs 1 digital and 1<br />
&gt; analogue signal to run. Therefore, I got an<br />
&gt; analogue signal using MCP4921 chip implementing<br />
&gt; SPI protocol. I have a digital output at say pin<br />
&gt; 4. Both digital and analogue signal are at the<br />
&gt; Arduino.<br />
&gt; 3- Digital signal will have 1 and 0 states i.e.,<br />
&gt; when it is 1, the printer should be printing and<br />
&gt; when 0, not printing. Analogue signal will be<br />
&gt; controlling the amplitude/amount of powder<br />
&gt; dispensed. More voltage, more powder dispensed,<br />
&gt; low voltage, less powder dispensed.<br />
&gt; <br />
&gt; I hope that creates an image of what I am after.<br />
&gt; If not, do let me know.<br />
&gt; <br />
&gt; Question:<br />
&gt; 1- How do I tell the printer that there is 1<br />
&gt; digital and 1 analogue signal at the Arduino ? In<br />
&gt; short, how to define/declare these 2 signals in<br />
&gt; the main code of the printer?<br />
&gt; 2- Is it possible to send a signal to the digital<br />
&gt; output, like 1 when the printer is printing (if<br />
&gt; LED is attached then ON) and 0 when not printing<br />
&gt; (if LED is attached then OFF). In short, is it<br />
&gt; possible for the printer to send a signal to the<br />
&gt; Arduino whenever it is printing and when it is not<br />
&gt; printing ?<br />
&gt; <br />
&gt; I know you are very good at programming and you<br />
&gt; might do this in a minute but it will be easier<br />
&gt; for me to explain the next question properly once<br />
&gt; these are solved :)<br />
&gt; And thanks a lot for helping me out. I really<br />
&gt; appreciate that.<br />
&gt; Cheers,<br />
&gt; Javaid<br />
<br />
I followed all this up until the part where you said this...<br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />
3- Digital signal will have 1 and 0 states i.e.,<br />
when it is 1, the printer should be printing and<br />
when 0, not printing. Analogue signal will be<br />
controlling the amplitude/amount of powder<br />
dispensed. More voltage, more powder dispensed,<br />
low voltage, less powder dispensed.</div></blockquote>
<br />
I am guessing that you wanted to say that a digital signal can have one of two possible states, 1 or 0 (on or off) and that the digital signal for pin 4 is to switch the powder dispenser on or off, let me know if this is wrong.<br />
<br />
In question one in your last post, you referred to "the printer", " How do I tell the printer that there is 1 digital and 1 analogue signal at the Arduino ?" when you say "the printer", do you refer only to the machine and it's gen 6 or the entire system including your arduino?<br />
<br />
You then said "how to define/declare these 2 signals in the main code of the printer?" if what you call "the main code of the printer" is the gen 6 code then you do not need to 'define' them in this code, the gen 6 cannot write to the pins on another board, only it's own, so to get the gen 6 to switch arduino pins you need to send a message to the arduino to do it (via i2c) <br />
<br />
the easiest way to do this is to use a simple command system, so for example you could make the arduino interpret the character '1' as "Turn on the dispenser" (in the receive event in the arduino you just need a simple if statement to do this) then when you want the gen6 to turn it on simply send the arduino the character '1', similarly, you can make '0' be the command to turn it off. This system isn't great if you need lots of different values on the DAC as there could only be 256 unique commands (8 bit binary, 0 to 255).<br />
<br />
Another option (although probably not the best for this application it would still be an effective and viable solution) is to develop a small protocol to give the gen 6 direct access to the arduino's pins (it's simpler than it sounds), each byte sent via i2c could contain a pin number in the lowest 4 bits, its state in the fifth and its mode in the sixth and then perhaps for efficiency the seventh bit could be to determine if the pin mode needs changing, that leaves one bit spare if you need it and therefore could be used to indicate that the next byte is to set an analog value (or the next two bytes if it is a high res DAC like yours), this would simplify the job that the arduino does and give full control to the gen 6, this would make switching on digital output 4 on the arduino from the gen 6 as simple as sending B00010100 down the i2c line and make setting an analog value as simple as sending these three: B10000000 B00111111 B11111111 (this example would set the 14 bit analog output to its maximum output) this would just turn the arduino into a simple i2c IO expander.<br />
<br />
if you need help implementing any of these suggestions then I will be able to help, just ask.]]></description>
            <dc:creator>danieljabailey</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Fri, 19 Aug 2011 05:23:01 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,94555#msg-94555</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,94555#msg-94555</link>
            <description><![CDATA[ All right. Here goes:<br />
1- 3D Printer has been assembled and it is communicating with Arduino via I2C.<br />
2- I need to connect a dry powder dispensing device to the printer. It needs 1 digital and 1 analogue signal to run. Therefore, I got an analogue signal using MCP4921 chip implementing SPI protocol. I have a digital output at say pin 4. Both digital and analogue signal are at the Arduino.<br />
3- Digital signal will have 1 and 0 states i.e., when it is 1, the printer should be printing and when 0, not printing. Analogue signal will be controlling the amplitude/amount of powder dispensed. More voltage, more powder dispensed, low voltage, less powder dispensed.<br />
<br />
I hope that creates an image of what I am after. If not, do let me know.<br />
<br />
Question:<br />
1- How do I tell the printer that there is 1 digital and 1 analogue signal at the Arduino ? In short, how to define/declare these 2 signals in the main code of the printer?<br />
2- Is it possible to send a signal to the digital output, like 1 when the printer is printing (if LED is attached then ON) and 0 when not printing (if LED is attached then OFF). In short, is it possible for the printer to send a signal to the Arduino whenever it is printing and when it is not printing ?<br />
<br />
I know you are very good at programming and you might do this in a minute but it will be easier for me to explain the next question properly once these are solved :)<br />
And thanks a lot for helping me out. I really appreciate that.<br />
Cheers,<br />
Javaid]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Thu, 18 Aug 2011 15:19:52 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,94488#msg-94488</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,94488#msg-94488</link>
            <description><![CDATA[ I have read your past three posts but couldn't figure out exactly what it was you were asking, could you please post your question again with any details and make them as clear as possible? Then (when I understand the problem fully) I will be able to help, thanks, Dan.]]></description>
            <dc:creator>danieljabailey</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Thu, 18 Aug 2011 06:37:10 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,93902#msg-93902</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,93902#msg-93902</link>
            <description><![CDATA[ I am stuck here big time.... I got the SPI working.... I have an analogue signal now.<br />
<br />
I want a digital signal as well. I connected a LED to pin 2 of Arduino and declared it as output. Here is the code:<br />
(&lt;&gt; in place of "")<br />
<pre class="bbcode">
#include "Wire.h"
#include "SPI.h" // necessary library
int del=2.5; // used for various delays
word outputValue = 0; // a word is a 16-bit number
byte data = 0; // and a byte is an 8-bit number
int ledPin = 2;                 // LED connected to digital pin 2


//i2c address of the gen 6
int REP_RAP_ADDR = 4;
//my address
int CP_ADDR = 5;

void receiveEvent(int howMany)
{
  while(0 &lt; Wire.available()) // loop through all
  {
    char c = Wire.receive(); // receive byte as a character
    Serial.print(c);         // print the character       
  }
}

void sendGCode(char* GCode)
{
  Wire.beginTransmission(REP_RAP_ADDR);
  Wire.send(GCode);
  Wire.endTransmission();   
}

void setup()
{
  Wire.begin(CP_ADDR);
  Wire.onReceive(receiveEvent); // register event so that anything received on i2c is sent to the serial

  //Test gcode, this should send the machine's X, Y and Z to home
  sendGCode("G28 X0 Y0 Z0\n");
pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  //set pin(s) to input and output
  pinMode(10, OUTPUT);
  SPI.begin(); // wake up the SPI bus.
  SPI.setBitOrder(MSBFIRST);

}

void loop()
{
{
  digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(1000);                  // waits for a second
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(1000);                  // waits for a second
}
 for (int a=0; a&lt;=4095; a++)
  {
    outputValue = a;
    digitalWrite(10, LOW);
    data = highByte(outputValue);
    data = 0b00001111 &amp; data;
    data = 0b00110000 | data;
    SPI.transfer(data);
    data = lowByte(outputValue);
    SPI.transfer(data);
    digitalWrite(10, HIGH);
    delay(del);
  }
  delay(del+25);
  for (int a=4095; a&gt;=0; --a)
  {
    outputValue = a;
    digitalWrite(10, LOW);
    data = highByte(outputValue);
    data = 0b00001111 &amp; data;
    data = 0b00110000 | data;
    SPI.transfer(data);
    data = lowByte(outputValue);
    SPI.transfer(data);
    digitalWrite(10, HIGH);
    delay(del);
  }
  delay(del+25);
}</pre>
<br />
It is a combination of 3 codes (I2C+SPI+LED).<br />
The problem is that I can't figure out how to tell the Gen 6 that there is a digital signal at pin 2 of Arduino and whenever Gen 6 prints, the LED at pin 2 should light up and when it is not printing, it should be off.<br />
<br />
I tried this routine as well but still LED is not blinking with respect to printing<br />
<pre class="bbcode">
#include 
int ledPin = 2;   

volatile long last_received_time;

//my address
int CP_ADDR = 5;

void receiveEvent(int howMany)
{  

  while(0 &lt; Wire.available()) // loop through all
  {
    char c = Wire.receive(); // receive byte as a character
    last_received_time = millis ();  // remember when we last got something
  }
}

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  Wire.begin(CP_ADDR);
  Wire.onReceive(receiveEvent); // register event so that anything received on i2c is sent to the serial
}

void loop()
{

  // light LED if we received data in the last second

  if (millis () - last_received_time &lt; 1000)  // if something in the last second
    digitalWrite(ledPin, HIGH);
  else
    digitalWrite(ledPin, LOW);

  // any other stuff
}</pre>
<br />
What should I do ??]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Fri, 12 Aug 2011 08:31:53 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,92247#msg-92247</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,92247#msg-92247</link>
            <description><![CDATA[ After putting<br />
#include "SPI.h" (they really are &lt;&gt;) at the top of the program.<br />
I am continuously trying to initialize SPI where you first initialized the I2C.<pre class="bbcode">.......
         tempControllerState = TEMPREG_INIT;
      }
    }
  #endif
#endif

void receiveEvent(int howMany)
{

}

void requestEvent()
{
  Wire.send("start");
}

SPI.init ()
void setup()
{
  disableTimerInterrupt();
  setupTimerInterrupt();
........</pre>
I hope it gives a good idea where I am trying to initialize the SPI but all in vain :S]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Thu, 28 Jul 2011 13:33:02 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,92246#msg-92246</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,92246#msg-92246</link>
            <description><![CDATA[ I already did that here. It does not really matter whether I put &lt;&gt; or " " for SPI.h, it works fine. <pre class="bbcode">
#include 
#include "SPI.h" // necessary library
int del=0; // used for various delays
word outputValue = 0; // a word is a 16-bit number
byte data = 0; // and a byte is an 8-bit number


//i2c address of the gen 6
int REP_RAP_ADDR = 4;
//my address
int CP_ADDR = 5;

void receiveEvent(int howMany)
{
  while(0 &lt; Wire.available()) // loop through all
  {
    char c = Wire.receive(); // receive byte as a character
    Serial.print(c);         // print the character       
  }
}

void sendGCode(char* GCode)
{
  Wire.beginTransmission(REP_RAP_ADDR);
  Wire.send(GCode);
  Wire.endTransmission();   
}

void setup()
{
  Wire.begin(CP_ADDR);
  Wire.onReceive(receiveEvent); // register event so that anything received on i2c is sent to the serial

  //Test gcode, this should send the machine's X, Y and Z to home
  sendGCode("G28 X0 Y0 Z0\n");
  //set pin(s) to input and output
  pinMode(10, OUTPUT);
  SPI.begin(); // wake up the SPI bus.
  SPI.setBitOrder(MSBFIRST);

}

void loop()
{
 for (int a=0; a&lt;=4095; a++)
  {
    outputValue = a;
    digitalWrite(10, LOW);
    data = highByte(outputValue);
    data = 0b00001111 &amp; data;
    data = 0b00110000 | data;
    SPI.transfer(data);
    data = lowByte(outputValue);
    SPI.transfer(data);
    digitalWrite(10, HIGH);
    delay(del);
  }
  delay(del+25);
  for (int a=4095; a&gt;=0; --a)
  {
    outputValue = a;
    digitalWrite(10, LOW);
    data = highByte(outputValue);
    data = 0b00001111 &amp; data;
    data = 0b00110000 | data;
    SPI.transfer(data);
    data = lowByte(outputValue);
    SPI.transfer(data);
    digitalWrite(10, HIGH);
    delay(del);
  }
  delay(del+25);
 
}</pre>
Now a dumb question. How and where should I initialize SPI protocol in the main Five_D program:S]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Thu, 28 Jul 2011 13:28:08 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,92233#msg-92233</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,92233#msg-92233</link>
            <description><![CDATA[ You simply need to merge the code you have just posted with the code I gave you in an earlier post.<br />
(this code...)<br />
<pre class="bbcode">
#include "Wire.h"

//i2c address of the gen 6
int REP_RAP_ADDR = 4;
//my address
int CP_ADDR = 5;

void receiveEvent(int howMany)
{
  while(0 &lt; Wire.available()) // loop through all
  {
    char c = Wire.receive(); // receive byte as a character
    Serial.print(c);         // print the character       
  }
}

void sendGCode(char* GCode)
{
  Wire.beginTransmission(REP_RAP_ADDR);
  Wire.send(GCode);
  Wire.endTransmission();   
}

void setup()
{
  Wire.begin(CP_ADDR);
  Wire.onReceive(receiveEvent); // register event so that anything received on i2c is sent to the serial

  //Test gcode, this should send the machine's X and Y to home
  sendGCode("G28 X0 Y0\n");
}

void loop()
{
  
}
</pre>]]></description>
            <dc:creator>danieljabailey</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Thu, 28 Jul 2011 12:21:45 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,92229#msg-92229</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,92229#msg-92229</link>
            <description><![CDATA[ I am getting analogue signal from the MCP4921 chip using this code<pre class="bbcode">
#include "SPI.h" // necessary library
int del=0; // used for various delays
word outputValue = 0; // a word is a 16-bit number
byte data = 0; // and a byte is an 8-bit number
void setup()
{
  //set pin(s) to input and output
  pinMode(10, OUTPUT);
  SPI.begin(); // wake up the SPI bus.
  SPI.setBitOrder(MSBFIRST);
}

void loop()
{
  for (int a=0; a&lt;=4095; a++)
  {
    outputValue = a;
    digitalWrite(10, LOW);
    data = highByte(outputValue);
    data = 0b00001111 &amp; data;
    data = 0b00110000 | data;
    SPI.transfer(data);
    data = lowByte(outputValue);
    SPI.transfer(data);
    digitalWrite(10, HIGH);
    delay(del);
  }
  delay(del+25);
  for (int a=4095; a&gt;=0; --a)
  {
    outputValue = a;
    digitalWrite(10, LOW);
    data = highByte(outputValue);
    data = 0b00001111 &amp; data;
    data = 0b00110000 | data;
    SPI.transfer(data);
    data = lowByte(outputValue);
    SPI.transfer(data);
    digitalWrite(10, HIGH);
    delay(del);
  }
  delay(del+25);
}</pre>
This code goes into the Uno. After uploading this code for SPI, the code for I2C (above) does not work.<br />
As I mentioned before, I want to print using a dry powder dispensing device. Now analogue signal is there at the Arduino but for the digital signal, I need to connect Arduino and Gen 6 by writing some routine.<br />
Could you refer me to some tutorial for this !!!]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Thu, 28 Jul 2011 11:14:52 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,91982#msg-91982</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,91982#msg-91982</link>
            <description><![CDATA[ SD card.....sounds cool :)<br />
<br />
MCP4921 chip is basically a 12 bit DAC so that will do. If I do get some problem, I know where to contact you :P (on the forum)]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Tue, 26 Jul 2011 08:06:24 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,91942#msg-91942</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,91942#msg-91942</link>
            <description><![CDATA[ That sounds like a good idea, I take it that the arduino's 8 bit PWM isn't up to the job then and that's why you need a 12 bit proper DAC.<br />
I hope to add many features to my gen 6 when I have time, an SD card is at the top of the list, anyway Good luck with it.]]></description>
            <dc:creator>danieljabailey</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Tue, 26 Jul 2011 01:31:53 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,91886#msg-91886</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,91886#msg-91886</link>
            <description><![CDATA[ My aim is to incorporate a dry power dispensing device on the printer for printing instead of the conventional extruder. It needs 2 signals to work (1 digital and 1 analogue). Digital is available from the Gen 6 board but for analogue, I needed something else. Therefore, I got Arduino. Now I will be using MCP4921 chip to get the analogue signal using the SPI protocol (I am still waiting for the chip to arrive):S<br />
<br />
And you have been of great help man. I guess, I got a bit overwhelmed by the delays in the order and wrote the post without even thinking much :P<br />
<br />
Anyways, that's the ultimate goal. What do you think of that !!!]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Mon, 25 Jul 2011 17:40:14 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,91872#msg-91872</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,91872#msg-91872</link>
            <description><![CDATA[ Javaid Butt Wrote:<br />
-------------------------------------------------------<br />
&gt; I want to print<br />
&gt; something using the Arduino usb <br />
&gt; What am I suppose to do for that ??<br />
Short answer: program the Arduino to do so. :)<br />
<br />
I'd like to know the answer to the question: How much programming experience do you have, arduino or otherwise?<br />
And another out of curiosity, what is the ultimate aim for this Arduino-Reprap-project?<br />
<br />
Surely you can figure out what you need to do now, you have the machine working, the arduino connected and communications working well, now it's your job to program the arduino to do what you want.<br />
<br />
Javaid Butt Wrote:<br />
-------------------------------------------------------<br />
&gt; Here's a question. At the moment, all Arduino is<br />
&gt; doing is bringing the 3 axes to their home<br />
&gt; positions.<br />
<br />
It seems you were expecting it to do more. This line:<br />
<pre class="bbcode">
sendGCode("G28 X0 Y0\n");</pre>
Tells the machine to home, that's all the arduino really does at the moment. :S<br />
<br />
Javaid Butt Wrote:<br />
-------------------------------------------------------<br />
&gt; Let's just say that I want to print<br />
&gt; something using the Arduino usb rather than the<br />
&gt; Gen 6 usb connected to my computer. <br />
&gt; <br />
&gt; What am I suppose to do for that ??<br />
<br />
I don't understand why you would want to do this as the gen 6 firmware that I gave you can accept commands from i2c and USB (even simultaneously, although it may do things in the wrong order then.)<br />
I tried to do this but then realised that it was pointless, just plug in the gen 6, if the arduino and gen 6 can communicate anything to each other (via i2c) then you can use either USB port to do anything (if you program it to do so).<br />
<br />
I assume that the arduino will do more than act as a 'middle-man' to communicate with the gen 6, but to get it to do that, you need to send all serial data coming in to the arduino to the i2c and send all the incoming i2c data back through the serial to the computer.]]></description>
            <dc:creator>danieljabailey</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Mon, 25 Jul 2011 16:50:08 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,91813#msg-91813</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,91813#msg-91813</link>
            <description><![CDATA[ Here's a question. At the moment, all Arduino is doing is bringing the 3 axes to their home positions. Let's just say that I want to print something using the Arduino usb rather than the Gen 6 usb connected to my computer. <br />
<br />
What am I suppose to do for that ??]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Mon, 25 Jul 2011 08:22:11 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,91657#msg-91657</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,91657#msg-91657</link>
            <description><![CDATA[ To stop the X axis from going beyond 100mm, just below this code (lines 389 and 390):<br />
<br />
<pre class="bbcode">
bool cartesian_dda::can_step(int min_pin, int max_pin, long current, long target, bool dir, bool inv)
{</pre>
<br />
You should add this code:<br />
<br />
<pre class="bbcode">
//stop if gone too far on x
    if (max_pin == X_MAX_PIN &amp;&amp; dir) //if this is x movement away from origin
    {
      if ((current/X_STEPS_PER_MM)&gt;=100) //going beyond 100?
        return false; //oh no you're not! :-)
    }
</pre>]]></description>
            <dc:creator>danieljabailey</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Sat, 23 Jul 2011 10:07:12 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?218,90583,91644#msg-91644</guid>
            <title>Re: Arduino with Gen 6 board</title>
            <link>https://reprap.org/forum/read.php?218,90583,91644#msg-91644</link>
            <description><![CDATA[ This is line 389<br />
<br />
bool cartesian_dda::can_step(int min_pin, int max_pin, long current, long target, bool dir, bool inv)<br />
<br />
By changing the above line, I will be restricting the movement of all the 3 axes (x, y &amp; z).<br />
<br />
I want to restrict the motion of x-axis only in the positive direction (away from the opto). Let's just sat when it reaches the opto (negative direction), it can then go in the positive direction only 100 mm (say). How can I achieve that ?]]></description>
            <dc:creator>Javaid Butt</dc:creator>
            <category>RepSnapper</category>
            <pubDate>Sat, 23 Jul 2011 08:20:33 -0400</pubDate>
        </item>
    </channel>
</rss>
