Show Posts
|
|
Pages: 1 2 [3] 4 5 6
|
|
31
|
Using Arduino / Installation & Troubleshooting / Re: experiencing first-time issues with the lilypad
|
on: May 02, 2011, 01:50:03 pm
|
|
If you are using the FTDI breakout board, you should make sure that none of the solder joints on the board are touching the Lilypad. Sometimes I use a small piece of felt in between the FTDI breakout board and the Lilypad Arduino just to be certain. You also need to make sure that you have no power on the Lilypad at the same time as you have it connected to the computer. If the Lilypad is connected to the computer, it is already getting power from it!
The best thing to do is unplug any additional components from your Lilypad, and connect just the Lilypad to the computer via USB. You should be able to get this working. If not, make sure you are not making any additional contacts with anything conductive. Make sure the solder joints on the back of the FTDI board are not touching any of the pins.
Hope this helps!
|
|
|
|
|
36
|
Using Arduino / Interfacing w/ Software on the Computer / Problem with arduino.analogWrite() in Processing
|
on: March 26, 2011, 10:14:21 pm
|
heya'z, I'm controlling 4 DC motors through Processing, using StandardFirmata on the Arduino. When I test the motors with a simple sketch in Arduino, they work perfect. When I try to actuate the motors through Processing, they do nothing. - I have checked the syntax of the Arduino library in Processing and I believe I have called the functions correctly. - I have printed a list of serial ports to confirm that I am listening to the correct port. - Both StandardFirmata and Processing are set to 9600 baud. - If I change the analogWrite() to digitalWrite(pin,HIGH), I am able to turn the motors on. Is there something I am missing when calling arduino.analogWrite() in Processing? Help, please and thank you!  import processing.serial.*; import cc.arduino.*; Arduino arduino;
int motor1 = 3; int motor2 = 5; int motor3 = 9; int motor4 = 10; int pulseWidth = 200;
void setup() { size(100,100); background(0); println(Arduino.list()); arduino = new Arduino(this, Arduino.list()[0], 9600); arduino.pinMode (motor1, Arduino.OUTPUT); arduino.pinMode (motor2, Arduino.OUTPUT); arduino.pinMode (motor3, Arduino.OUTPUT); arduino.pinMode (motor4, Arduino.OUTPUT); }
void draw() { arduino.analogWrite(motor1, pulseWidth); arduino.analogWrite(motor2, pulseWidth); arduino.analogWrite(motor3, pulseWidth); arduino.analogWrite(motor4, pulseWidth); }
|
|
|
|
|
39
|
Forum 2005-2010 (read only) / Troubleshooting / ClassNotFoundException: processing.serial.Serial
|
on: September 22, 2010, 11:46:38 pm
|
I cant for the life of me figure out what the problem is with my Processing code. When I compile it, I get this error: ClassNotFoundException: processing.serial.Serial and it highlights this area of code: arduino = new Arduino(this, Arduino.list()[0], 9600); I've assigned it different comports, I've double checked the baudrate in Standard Firmata against this code, I've declared arduino as an object and imported the library.... what am I overlooking? here is the Processing code: import cc.arduino.*; import ddf.minim.*;
Arduino arduino; Minim minim; AudioPlayer heart;
int ledPin1 = 0; int ledPin2 = 1; int ledPin3 = 2;
void setup() { size(512,200); background(255); minim = new Minim(this); arduino = new Arduino(this, Arduino.list()[0], 9600); int ledPin1; int ledPin2; int ledPin3; }
void draw() { background(255); playSound(); }
void playSound() { do { arduino.digitalWrite(ledPin1, Arduino.LOW); // set first bundle of LEDs off arduino.digitalWrite(ledPin2, Arduino.LOW); // set second bundle of LEDs off arduino.digitalWrite(ledPin3, Arduino.LOW); // set third bundle of LEDs off
heart = minim.loadFile("heart.wav"); heart.play(); arduino.digitalWrite(ledPin1, Arduino.HIGH); // set first bundle of LEDs HIGH wait(30); arduino.digitalWrite(ledPin2, Arduino.HIGH); // set second bundle of LEDs HIGH wait(30); arduino.digitalWrite(ledPin3, Arduino.HIGH); // set third bundle of LEDs HIGH do { // do nothing until the file ends } while (heart.isPlaying()); } while (true); }
void wait(int seconds) { do { delay(1000); seconds--; } while (seconds > 0); }
void stop() { heart.close(); minim.stop(); super.stop(); }
|
|
|
|
|
40
|
Forum 2005-2010 (read only) / Interfacing / Re: Lilypad + Lilypad Accelerometer + Processing
|
on: August 31, 2010, 02:07:19 am
|
I'm using the Lilypad Mega 168 with a Lilypad Accelerometer (ADXL330). This is the Arduino code that works: int sensorPinX = 0; int sensorPinY = 1; int sensorPinZ = 2; int sensorValueX; int sensorValueY; int sensorValueZ; void setup() { pinMode(sensorPinX, INPUT); pinMode(sensorPinY, INPUT); pinMode(sensorPinZ, INPUT); Serial.begin(9600); } void loop() { sensorValueX = analogRead(sensorPinX)*10; sensorValueY = analogRead(sensorPinY)*10; sensorValueZ = analogRead(sensorPinZ)*10; Serial.print(sensorValueX,DEC); Serial.print(","); Serial.print(sensorValueY, DEC); Serial.print(","); Serial.println(sensorValueZ, DEC); delay(500); } The Processing sketch has worked intermittently, which is to say that today I could read XYZ coords in the serial monitor in Processing, however it was brief, and then went back to zeros. Might be a hardware problem.
|
|
|
|
|
42
|
Forum 2005-2010 (read only) / Interfacing / Re: Lilypad + Lilypad Accelerometer + Processing
|
on: August 30, 2010, 07:54:02 am
|
hahah  Well, I keep getting 0s when reading the data in Processing, even if in my Arduino sketch I'm getting proper data! So, I was suspecting that I was not calling the Arduino library functions (ie. arduino.analogRead()), or maybe this line is incorrect: arduino = new Arduino(this, Arduino.list()[0], 9600); or maybe there is something I am overlooking completely?
|
|
|
|
|
44
|
Forum 2005-2010 (read only) / Interfacing / Lilypad + Lilypad Accelerometer + Processing
|
on: August 29, 2010, 09:57:02 pm
|
Hi all, I'm having trouble with my code for the lilypad accelerometer (adxl330). I want to import the real time sensor data from the accelerometer into Processing so that I can "draw" with it. In my Processing code, do I import the Lilypad sensor data as "arduino.analogRead()" ? Here is a snippet: import cc.arduino.*; import processing.serial.*; Arduino arduino;
int sensorPinX = 0; int sensorPinY = 1; int sensorPinZ = 2; int[] xArray = new int[8]; int[] yArray = new int[8]; int[] zArray = new int[8]; int [] sensorValueX = new int[50]; int [] sensorValueY = new int[50]; int [] sensorValueZ = new int[50];
int BAUDRATE = 9600; char DELIM = ',';
void setup() { arduino = new Arduino(this, Arduino.list()[0], 9600);
int i; size(1440, 900); noStroke(); noCursor(); for (i = 0; i < sensorValueX.length; i++) { sensorValueX[i] = 0; sensorValueY[i] = 0; sensorValueZ[i] = 0; } }
void draw() { int i; int xpos; int ypos; int zpos;
background(0); noStroke();
xpos = arduino.analogRead(sensorPinX); addEntry(xpos,xArray); ypos = arduino.analogRead(sensorPinY); addEntry(ypos,xArray); zpos = arduino.analogRead(sensorPinZ); addEntry(zpos,zArray);
print(xpos); print(" "); print(ypos); print(" "); println(zpos);
addEntry(getAverage(xArray),sensorValueX); addEntry(getAverage(yArray),sensorValueY); addEntry(getAverage(zArray),sensorValueZ);
|
|
|
|
|