Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / Re: Arduino Uno I2C with (motorshield) in Matlab on: December 17, 2012, 08:25:54 pm
I have tried to add the Wire library to the srv.pde to establish an I2C,

The slave code:

#include <Wire.h>

void setup()
{
Wire.begin(100);
Wire.onReceive(receiveEvent);
}

void loop()
{
}

void receiveEvent( int howMany)
{
while (Wire.available())
{
}
}



The master code, is the srv.pde and I added:
#include <Wire.h>
#include <AccelStepper.h>

and to the void loop(), I added

Wire.beginTransmission (100);



Do I need to end the transmission (I mean add Wire.endTransmission() to the code)? Or the transmission should automatically end when I disconnect the arduino?


Adding #include <AccelStepper.h> to the code didn't seem to have an effect, the 2 motors still don't run simultaneously. What do I have to do to fix this?

 
 


2  Using Arduino / Networking, Protocols, and Devices / Re: Arduino Uno I2C with (motorshield) in Matlab on: December 14, 2012, 02:20:58 am
Attached is the srv.pde code (MATLAB Support Package for Arduino (aka ArduinoIO Package)).
(http://www.mathworks.com/matlabcentral/fileexchange/32374-matlab-support-package-for-arduino-aka-arduinoio-package)
3  Using Arduino / Networking, Protocols, and Devices / Arduino Uno I2C with (motorshield) in Matlab on: December 13, 2012, 09:34:14 pm
Hi,


Little background:
I am working on a project to run 2 stepper motors simultaneously using Matlab. I was able to run the 2 motors in Matlab using an Uno and a motorshield (after uploading the srv.pde. The srv.pde is required for the shield to work in my case.), but I wasn't able to run the motors simultaneously.

I tried I2C with an another Uno and using the Wire library (http://arduino.cc/en/Tutorial/MasterWriter) in addition to the AccelStepper library, I was able to run the motors simultaneously using the Arduino 1.0.2 software.


My question is:
Is there a way of adding the Wire and AccelStepper libraries to the srv.pde so that I can use I2C and AccelStepper in Matlab? Is there another way of running 2 motors simultaneously using Matlab?


Thank you.
4  Using Arduino / Installation & Troubleshooting / Re: Arduino UNO R3 Stopped working on windows/mac on: December 06, 2012, 07:06:04 pm
Hi all,

Does that mean that the ATmega328p-pu chip is faulty?
Pages: [1]