Show Posts
Pages: [1] 2
1  Forum 2005-2010 (read only) / Troubleshooting / Re: ARDUINO BT serial communication problem on: December 22, 2007, 09:06:54 am
It seems to be a problem related to the 009 IDE version,
this is what I was told,
try using the 007 or the new 0010,
unfortunately I'm not at home in these days so I can't check.
Will let you know as soon as I can try,
ciao
gio
2  Forum 2005-2010 (read only) / Troubleshooting / ARDUINO BT serial communication problem on: August 22, 2007, 09:48:44 am
BT problems!
Running OSX 10.4.8 and 009 IDE version,
power the board with 5,5 V (+/- 0.2 V),
using a Sharp IR range sensor on analog input 0.

I can easily pair the BT board and managed to read analog input data from the IDE serial monitor,
but ONLY IF I open the serial monitor RIGHT AFTER hardware resetting the board with the switch,
just as you do to upload code to the board.
If I power the board and try to open the serial monitor after, say, 5 seconds, I got the discouraging message:

Error inside Serial.<init>()
gnu.io.PortInUseException: Unknown Application
      at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354)
etc...


I need to place 2 BT boards far away from the pc so I can't push the reset button on the boards
everytime I want to start the serial communication.
I don't think it's a power issue, coz once it's connected and going, it's stable for hours and hours
(tried to keep it working all night long and the board behaved perfectly).

Is there a known solution to this problem?
I've seen that the Diecimila board has a sort of automatic reset switch
and that maybe even the BT board can be modified, but I'm a bit afraid of frying everything!!!

Any help would be REALLY appreciated,
have bright days,
gio
3  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino BT can't find bluetooth serial service on: August 22, 2007, 09:28:25 am
BT problems for me too!
Running OSX 10.4.8 and 009 IDE version,
power the board with 5,5 V (+/- 0.2 V),
using a Sharp IR range sensor on analog input 0.

I can easily pair the BT board and managed to read analog input data from the IDE serial monitor,
but ONLY IF I open the serial monitor RIGHT AFTER hardware resetting the board with the switch,
just as you do to upload code to the board.
If I power the board and try to open the serial monitor after, say, 5 seconds, I got the discouraging message:
Error inside Serial.<init>()
gnu.io.PortInUseException: Unknown Application
      at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354)
etc...

I need to place 2 BT boards far away from the pc so I can't push the reset button on the boards
everytime I want to start the serial communication.
I don't think it's a power issue, coz once it's connected and going, it's stable for hours and hours
(tried to keep it working all night long and the board behaved perfectly).
Is there a known solution to this problem?
I've seen that the Diecimila board has a sort of automatic reset switch
and that maybe even the BT board can be modified, but I'm a bit afraid of frying everything!!!

Second problem: I need to read data in Max/Msp,
got all the code working and communication is ok when I use the USB Arduino,
but it seems that Max/Msp can't open the BT connection to the board on its own:
I noticed that the only times (out of countless trials) it worked with BT
was when I managed to open the connection using the IDE serial monitor
and then start Max/Msp while the connection was kept open by the IDE,
then close the SerialMonitor in the IDE, and voilà, the data was there happily flowing in Max/Msp!!!
Didn't have to do all this hassle with the USB version, cos it's a Bluetooth issue, I guess.
A bit ankward solution but the only way I found to use it.
So this seems to be the right procedure:
Power BT board
Open Arduino IDE->Start SerialMonitor,
Hardware reset BT board,
ONLY AFTER the connection is estabilished and working (->you can read the data in the serial monitor window)
open Max/msp and start serial reading,
then close the SerialMonitor in the IDE and start rocking.

Anyone got a better method???
Can't max/msp open a connection by itself when you start reading serial data with its "Serial" module?

Searched on the maxmsp forums but got no clue about that.

Last question:  :o
Can I render the BT board invisible to other devices other than my computer?
I don't want people try to connect to the board while it's working!
even if they can't acces it I suppose that the connection BTboard<->Computer
could be affected by, say, cellphones or laptops in the area trying to connect to the BTboard...

That's all for now, sorry for the extra long post!
Any help would be REALLY appreciated,
hope this post was useful to someone,
have bright days,
gio
4  Forum 2005-2010 (read only) / Troubleshooting / Re: ArduinoBT setup e uploading on: August 24, 2007, 01:02:57 pm
Ciao,
try RESETTING the board with the button near the ICSP pins
right before pressing the UPLOAD TO I/O BOARD,
it should work.
Best,
kk
5  Forum 2005-2010 (read only) / Syntax & Programs / Re: Apparent problem w/ no SRAM but not [SOLVED] on: August 07, 2009, 05:33:11 am
Thanks a lot 3FN that was ->sweeeeeet<-
gonna study hard, but now things got much clearer!
And i discovered that a lot of problems where due to the atmega8 I had on myold NG,
 I've replaced it with a 168 and everything works now!

If someone is interested in Arduino+PWM info check here:
http://arcfn.com/2009/07/secrets-of-arduino-pwm.html
Tattik check it out maybe it can help you.

Double bless to 3FN  :o
kk
6  Forum 2005-2010 (read only) / Syntax & Programs / Re: Apparent problem w/ no SRAM but not [SOLVED] on: August 06, 2009, 10:29:11 am
Thanks, I managed to set the I2C address for each matrix,
that was easy!

But now I'm reading the code in the Rainbow_CMD_V2_0 sketch,
and can't understand how to use the hex code to dim the LED I want. For example, to  show ascii charachter A it's:  {0x0,0x78,0x44,0x78,0x40,0x38,0x0,0x0}
How does this translates into informations for single LEDs?
I know it's a mixture of shift registers and some magic,
but I'm quite lost at the moment...
Hope someone can help with this,
thanks a lot for the moment!
ciao,
gio

7  Forum 2005-2010 (read only) / Syntax & Programs / Re: Apparent problem w/ no SRAM but not [SOLVED] on: August 05, 2009, 02:29:14 pm
Hi,
nice to hear you managed to make it work!
I'd be interested in knowing more and seeing the code if possible,
I'm currently learning and some working example can help me so much!
What I'm trying to do is
to send patterns to 4-rainbowduino chained together,
 but I'm a bit loss:
how can I address single rainbowduino_matrix on a I2C bus?
how should I format a 64x64 pixel image to send it to the matrix?

Thanks a lot,
have a nice day,
gio

conti.gio AT gmail DOT com
8  Forum 2005-2010 (read only) / Interfacing / ARDUINO BT + MAXMSP on: August 22, 2007, 09:34:46 am
Bluetooth board problem with MaxMsp!!!

Running OSX 10.4.8 and 009 IDE version, max/msp 4.6.2.
power the board with 5,5 V (+/- 0.2 V),
using a Sharp IR range sensor on analog input 0.

I need to read the serial data in Max/Msp,
got all the code working and communication is ok when I use the USB Arduino,
but it seems that Max/Msp can't open the BT connection to the board on its own:
I noticed that the only times (out of countless trials) it worked with BT
was when I managed to open the connection using the IDE serial monitor
and then start Max/Msp while the connection was kept open by the IDE,
then close the SerialMonitor in the IDE, and voilà, the data was there happily flowing in Max/Msp!!!
Didn't have to do all this hassle with the USB version, cos it's a Bluetooth issue, I guess.
A bit ankward solution but the only way I found to use it.
So this seems to be the right procedure:
Power BT board
Open Arduino IDE->Start SerialMonitor,
Hardware reset BT board,
ONLY AFTER the connection is estabilished and working (->you can read the data in the serial monitor window)
open Max/msp and start serial reading,
then close the SerialMonitor in the IDE and start rocking.


Anyone got a better method???
Can't max/msp open a connection by itself when you start reading serial data with its "Serial" module?

Searched on the maxmsp forums but got no clue about that.

Any help would be REALLY appreciated,
hope this post was useful to someone,
have bright days,
gio
9  Forum 2005-2010 (read only) / Interfacing / Re: Maxbotix sonar (analog) Working code on: June 19, 2007, 07:19:00 am
@aztlan2k:

sorry for the delay,
with maxbotix ez-1 you only have 3 wires between the sensor and arduino,
the 5v+ and ground going from arduino to the sensor +/-
and the analog output from the sensor going to an analog input pin on arduino,
then simply use the code I proveded in the forum (search for srf08 or maxbotix)
and you are ready to rock...
beware of the cable length!
as you're going to use an analog signal voltage,
long cables will introduce lot of noise in the signal,
i used 10m once but the readings were very noisy,
look on the maxbotix website, in the faq they explain how you can reduce noise using a resistor and a capacitor...
hope this helps you,
have bright days
gio
10  Forum 2005-2010 (read only) / Interfacing / Maxbotix sonar (analog) Working code on: June 19, 2006, 11:14:53 am
(dunno if this is the right place to post)

I tried to use the Devantech SRF08 I2C sonar but with no luck
(check the forum, no one replied to my request for help so I suppose it's impossible to use
as the I2C/TWI code is too big for the small Arduino's memory).
Finally I got this Maxbotix ultrasonic range finder and
used the analog output to connect it to Arduino.

Notice: This is a rework of the code for the Parallax PING,
they say it works with the Maxbotix sensor too
but I couldn't understand which sensor output they use.
Go analog, simple and smooth.
Enjoy,
GiovanniConti

conti.gio@gmail.com


/*

+++ Maxbotix ultrasonic range finder +++

- Sensor is connected to arduino ANALOG-0
- Range in centimeters = (val * 1,24)
- A led connected to DIGITAL-13 blinks, speed is proportional to the sensed value
 --- > share your knowledge < ---
 
 (( Lorenzo + Giovanni ) Conti ) 18/06/2006
 
 
 */


int ultraSoundSignal = 0; // Ultrasound signal pin ANALOG-0
int val = 0;
int ultrasoundValue = 0;
int ledPin = 13;                 // LED connected to DIGITAL-13

void setup() {
  beginSerial(19200);                  // Sets the baud rate to 19200
  pinMode(ledPin, OUTPUT);      // sets the DIGITAL-13 pin as output  
  
}

void loop() {
 val = 0;

pinMode(ultraSoundSignal, INPUT); // Switch signalpin ANALOG-0 to input
val = analogRead(ultraSoundSignal); // Append signal value to val

digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(val);                  // waits, proportional to the sensed value
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(val);                  // waits, proportional to the sensed value

/* Writing out values to the serial port
 * -------------------------------------------------------------------
 */
 
ultrasoundValue = val; // Append analog read to ultrasoundValue

serialWrite('A'); // Example identifier for the sensor
printInteger(ultrasoundValue);
serialWrite(10);
serialWrite(13);


/* Delay of program
 * -------------------------------------------------------------------
 */
delay(100);
}
11  Forum 2005-2010 (read only) / Italiano / Re: alimentazione pin analogici on: October 02, 2009, 11:59:31 am
Per arduino non cambia niente se i 5v vengono da un pin suo o da un alimentatore esterno:
lui si limita a convertire il voltaggio in ingresso negli ANALOG input in un valore da 0 a 1024.

Per il potenziometro:
- un pin sarà il voltage input, che devi collegare al pin 5V di arduino o all'alimentatore che vuoi usare
- un pin sarà il gnd, che devi collegare al GND di arduino/alimentatore
- un pin sarà l'uscita del pot, che devi collegare ad un ANALOG INPUT di arduino.

Di solito i pin esterni sono +/GND, quello interno è l'uscita del pot.
Per una descrizione dettagliata dei vari utilizzi, guarda qua:
http://www.kpsec.freeuk.com/components/vres.htm

Spero di esserti stato utile,
buona fortuna,
kk
12  Forum 2005-2010 (read only) / Italiano / Re: Servo + bottom on: October 02, 2009, 11:41:39 am
Ciao fausto, mi sa che ci conosciamo  8-)

per usare un altro servo basta che lo dichiari come hai fatto con il primo,
dando un nome diverso sia ai servi che alle variabili/funzioni.

Una roba del genere dovrebbe funzionare,
sostituisci a X000 i millisecondi che ti servono:


Code:
int servo1 = 9; // servo 1 -> pin 9
int servo2 = 10;// servo 2 -> pin 10

int left_pulse = 550;   // left (you may need to reverse left and right for your servo)
int mid_pulse = 1300; // tweek this for your actual mid position
int right_pulse = 2200;

void setup(){  
pinMode(servo1, OUTPUT);
pinMode(servo2, OUTPUT);
Serial.begin(9600);
}


void updateServo1( int pulse){
 digitalWrite(servo1, HIGH);
 delayMicroseconds(pulse);
 digitalWrite(servo1, LOW);
 delay(20);  // 20 millisecond delay between pulses is required for the servo
}


void updateServo2( int pulse){
 digitalWrite(servo2, HIGH);
 delayMicroseconds(pulse);
 digitalWrite(servo2, LOW);
 delay(20);  // 20 millisecond delay between pulses is required for the servo
}


void loop(){
unsigned long startTime;

  startTime = millis();  // set our timer
  while(millis() - startTime <   1000) {  // loop for 1 second
      updateServo1(left_pulse);
  }

while(millis() - startTime <   X000) {  // loop for X seconds
      updateServo2(left_pulse);
    
  }

  startTime = millis();  //restart timer
  while(millis() - startTime <   1000) {  // loop for one second
      updateServo1(right_pulse);
  }

 while(millis() - startTime <   X000) {  // loop for X seconds
      updateServo2(right_pulse);
  }



}
13  Forum 2005-2010 (read only) / Troubleshooting / Re: ArduinoBT on Mac OS X Leopard on: June 03, 2008, 03:53:26 pm
Quote
kk: have you tried resetting the BT module from within your sketch?  There's an example here: http://www.arduino.cc/en/Main/ArduinoBTInitializationSketch.  

Thanks for the answer Mellis!


I uploaded the BT configuration reset sketch, the led happily blinked so it was executed for sure.
But still I get errors if I try to open the serial port without resetting the board. I'm on OSX 10.4.8.

I get this:
"Serial port already in use. Try quitting any programs that may be using it."
And this console message:
"processing.app.SerialException: Serial port '/dev/tty.ARDUINOBT-BluetoothSeri-1' already in use.  
Try quiting any programs that may be using it. ..."

No other program is using the port (at least visible programs)
I have disabled the file exchange services from osx BT preferences,
and still I can only connect with the same procedure:
reset the board and press serialmonitor just after resetting.
With this I can always connect, but it's not really useful for a wireless device...
I have 2 boards, both behave in the same way, both are BT-V06.

Have checked the background processes of OSX that involve bluetooth, and maybe keep the port busy,
because it seems that I can connect only during the "reset pause"
and that once the code starts running there's no way to connect without resetting.
Found only this "blued" that should manage the BT connection but don't know exactly how to go further...
If anyone can help I'd really appreciate, I'm totally clueless and wanna use this boards...  

Thanks for your attention,
bless,
kk
14  Forum 2005-2010 (read only) / Troubleshooting / Re: ArduinoBT on Mac OS X Leopard on: May 04, 2008, 08:35:01 am
Hallo,
I'm still trying to get the Arduino BT board start transmitting data
without the need of resetting it just before opening the serial transmission.
I'm not talking about uploading sketches, even reading data from the BT board is impossible without resetting it...
If I don't reset the board, on OSX the BT symbol in the topright Finder toolbar doesn't change to active,
and I get the usual "port already in use by another application" exception...
I need to use the BT board in outdoor installations,  making it impossible to reach them by hand to press the onboard reset button.

Last year I posted this procedure to the forum,
and still have found no better ways to get data from the BT board to Max/Msp:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1185415792/7#7

1) Power the Arduino BT board
2) Open Arduino IDE,
configure Board (Arduino BT) and Port (both CU-TTY work for me)
3) Open Serial Monitor and IMMEDIATELY hardware reset the BT board,
4) ONLY when the connection is estabilished and working
(you see by the BT symbol in the topright bar changing to connected,
 and if you have some "println" in your sketch,
you should see the numbers flowing in the Serial Monitor window)
open Max/msp and start serial reading, then stop Arduino Serial Monitor.

This is the only procedure working 100% for me.

If I try to start reading serial data directly from Max, it seems that the board doesn't manage to connect,
while if I try to read data from Arduino Serial Monitor without resetting the board just after pressing the Serial Monitor button,
 I get an error about board being already in use by another application.

Wouldn't be possible to embed some auto-reset command in the BT sketches or firmware when the serial port is open by the computer,
so that when you want to start serial readings the board reset itself and can start trasmitting data?
I've read all the forum posts about this but can't find anything helpful.
I'm no programmer or electronic engeneer, so apologize in advance if this is a stupid request,
thanks,
kk
15  Forum 2005-2010 (read only) / Troubleshooting / Re: can not pair Bluetooth (BT)!! on: May 04, 2008, 08:08:12 am
Try resetting the board with the builtin button just before you press the 12345 passkey enter,
it worked for me on OSX... and even when you want start reading data from Serial Monitor or other application,
just reset with the button right before starting the serial communication,
this is the only way of making it work for me...
it seems that there's a 2 seconds time window that you have to catch, when it's gone the BT board refuse to do anything.
Hope someone can find a solution,
ciao
gio
Pages: [1] 2