Show Posts
Pages: 1 2 [3] 4 5 ... 9
31  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: add ability to write to EEPROM on: May 25, 2006, 08:17:57 am
you asked it for
the wiki is now updated

the Eeprom library can be a very good thing to understand how to code libraries...
I'll see if I can give it a try...if I only could find a spare life lying around  smiley-razz

thanks mellis
b.

32  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: add ability to write to EEPROM on: May 25, 2006, 05:34:05 am
seek the "hidden powers" and ye shall find ;-)

look in the playground wiki under the code section
http://www.arduino.cc/playground/Main/CodeLib

cheers
b.
33  Forum 2005-2010 (read only) / Syntax & Programs / Re: can't print a float value??? on: February 06, 2007, 12:51:08 pm
AVR Lib can be found here
http://www.nongnu.org/avr-libc/user-manual/modules.html

as suggested in the playground
http://www.arduino.cc/playground/Learning/Programming

I've also found this other link but it's not official
http://www.sigterm.de/projects/sens-o-nuts/Dokumentation/atmel/libc/
34  Forum 2005-2010 (read only) / Syntax & Programs / Re: can't print a float value??? on: February 03, 2007, 05:07:06 am
thanks mellis,
the reason is I'm playing around with an accelerometer that is giving me very slight values
and I'm checking with the reference voltage that is going into the accelerometer.

I've seen that on some tutorials tom igoe is using digital pins with his pulseIn function to detect the data from the accelerometer...however i've hooked my dual axis to 2 arduino analog pins
and it's voltage reference to another arduino analog pin so I can check what Vin really is.

I know I could do that with a multimeter but I'm doing so that I can have a double reference

now for your solutions in fact does seem mathematically interesting smiley-wink

are you suggesting this?

float Vfloat;
int Vint  
Vfloat = analogRead (VinPin); //reads 665.6
Vint = (int)(Vfloat);
Serial.print(Vint);                   //prints 665

or this?

float Vfloat;
int Vint  
Vfloat = analogRead (VinPin); //reads 665.65
Vint = (int)(Vfloat*1000);
Serial.print(Vint);                   //prints 665650


another doubt is: to convert it to the 5 volt range I will have to multiply that to (5/1024)
is that correct?
ie:

Vint = (int)(Vfloat*1000*(5/1024));
Serial.print(Vint);                   //prints 3250 which means 3,2 V

that would be what my multimeter displays.
thanks as usual smiley
35  Forum 2005-2010 (read only) / Syntax & Programs / can't print a float value??? on: February 02, 2007, 06:55:36 am
I'm getting a problem trying to Serial.print a float value
(I've read http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1169275761, but he is trying to cast it to int which I don't want)
I need to read the floating point numbers

is it possible at all to do Serial.print(myFloatVar) ???

this is the debugger warning

error: call of overloaded 'print(float&)' is ambiguous
C:/DEV/_ARDUINO/arduino-0007/lib/targets/arduino/HardwareSerial.h:42: note: candidates are: void HardwareSerial::print(char)


C:/DEV/_ARDUINO/arduino-0007/lib/targets/arduino/HardwareSerial.h:44: note:                 void HardwareSerial::print(uint8_t)


C:/DEV/_ARDUINO/arduino-0007/lib/targets/arduino/HardwareSerial.h:45: note:                 void HardwareSerial::print(int)


C:/DEV/_ARDUINO/arduino-0007/lib/targets/arduino/HardwareSerial.h:46: note:                 void HardwareSerial::print(unsigned int)


C:/DEV/_ARDUINO/arduino-0007/lib/targets/arduino/HardwareSerial.h:47: note:                 void HardwareSerial::print(long int)


C:/DEV/_ARDUINO/arduino-0007/lib/targets/arduino/HardwareSerial.h:48: note:                 void HardwareSerial::print(long unsigned int)


do I have to modify the Serial lib to accept floating point values on the serial port?
thanks
b.
36  Forum 2005-2010 (read only) / Interfacing / Re: Arduino BT connection refuse on: October 21, 2007, 02:32:51 pm
I answer here to your email

I'm sorry I don't have an arduino bluetooth so I don't really know what the setups are...
if you ever find the answer post it on your own post so that others can benefit from your investigation

have you tried to connect to the arduino bt via a terminal? without setting up the serial proxy+flash configuration.
if a simple terminal cannot connect then you know that you might have a problem in the connection between

arduino bt - computer (either of the two might have a problem: wrong speed, wrong port etc)

if the terminal does connect but you can't connect to flash
you might deduce that the problem is in fact in the connection between
computer - serial proxy - flash  

good luck
b.

37  Forum 2005-2010 (read only) / Interfacing / Re: pduino [arduino] object in puredata on: May 24, 2006, 02:59:41 pm
I'll copy here for everybody the discussion we had via e-mail
in Flash it can be a lot more complicated, but not impossible.

I didn't understand how pd handles the incoming data
how do you register an object in pd to a specific imput from Arduino?
how do you do something like this
val1 = analogRead(pin5)
val2 = digitalRead(pin6)

you wrote in the e-mail
Quote
To start read data from Arduino, you wait for the cycle marker byte:  255.  Then you are at the top of the cycle.  The next byte is digital  pins 0-6, then digital pins 7-14.  Then comes byte pairs for each  analogIn, which are reassembled to make the 10-bit value.  To send  digital data to Arduino, its just a 3 byte cycle, 255 for the marker,  one by for digital pins 0-6 and the next byte for pins 7-13.

I can understand if you serialize the data coming from Arduino
so that Arduino sends a long "string" or byte-cycle like
255   0 0 0 0 0 0   0 0 0 0 0 0    ?-? ?-? ?-? ?-? ?-?
where
- 255 is the starting cycle marker
- 6 bytes for digital pin 1->6
- 6 bytes for digital pin 7->14
- 5 pairs(?-?) what do they look like (I have to test it yet)

in this case is a bit easyer
there is only one object that listens to the incoming data and then dispatches the different information
to whoever is listening...or they simply pull the data from the dataset...
it could create some asyncronous computation but I'm not sure
I fear that it can be a mess to code for the user...but i'll give it a try

in the end of the day it would be great to code in Actionscript something like
// read analog value
val = Arduino.pin0.value
//set digital value
Arduino.pin6.value = HI;
//set action
Arduino.pin9.pulseTo(someValue)

in fact the pulsing could be handled internally by Flash with no problems and just sending single digitalWrites at the specified rate..that could be really cool...and doing FFT inside flash  :o  8-)

What I fear is that the architecture would ask the user to code more or less the same things inside Flash that he would do in Arduino...I can see almost no point in that

it could be great if you could explain on the wiki a bit better the "string" that has to be SENT TO Arduino to set commands and the "string" that is RECEIVED FROM Arduino..
give some examples, it would make it easier.

I'll try it out

b.
38  Forum 2005-2010 (read only) / Interfacing / Re: flash interfacing on os x on: May 21, 2006, 10:04:51 am
does that mean that if in arduino3 you could write any C code in the sketch
now in arduino4 you should could write code in C++???

if that is the case do you have any good online reference or resource to maybe post on the playground wiki so that people can learn c++ and the differences between it and simple C?

any ideas?
thanks in advance
cheers
b.
39  Forum 2005-2010 (read only) / Interfacing / Re: flash interfacing on os x on: May 19, 2006, 08:00:14 am
thanks for pointing it out...
are you compiling it with arduino4?
the fact is that I've never tryed it yet with arduino4...and heard other people around are having this kind of problems: code written for previous versions of arduino seem to be buggy in arduino4...

this is a question for mellis: is it a backwards compatibility problem or is it that previous versions of arduino led us all to bad coding conventions?

cheers
b.
40  Forum 2005-2010 (read only) / Interfacing / Re: flash interfacing on os x on: May 18, 2006, 01:58:01 pm
yes that might be it!
the serial proxy configuration defaults to 9600 bauds (at least the version I've got locally)

# Default settings
comm_baud=9600

either edit this or the beginSerial value in the Arduino code


another thing that sometimes happens is that EVEN if the bothe speed are the same
somenthing goes wrong in the exchange and the two processors start talking nonsense to each other

a very simple solution to this problem is to reset the arduino board (through its reset button)
while the serial connection is still open...everything will work perfectly

cheers
b.
41  Forum 2005-2010 (read only) / Development / Re: Windows command line build on: January 08, 2007, 03:24:25 pm
hey cosine,
that looks great, I started playing with the makefile but couldn't solve it in 5 minutes..

thanks also for all the contributions and addition to the playground smiley-wink

b.
42  Forum 2005-2010 (read only) / Italiano / Re: Arduino + Servomotori on: March 16, 2006, 03:35:12 pm
ciao corrado,
non ho nessuna esperienza con servomotori...devo ancora procurarmene uno
( a proposito tu dove lo hai pescato?)

comunque per quel poco che vedo il problema potrebbe risidere nel fatto che usi il pwm
e sostanzialmente gli dai due comandi opposti in brevissimo tempo
cioè non fa neanche in tempo ad iniziare il movimento verso i 90° che già gli dici di tornare indietro smiley

se noti l'esempio che fa tom igoe, invece di un ANALOGWRITE (impulso analogico in uscita) come il tuo
usa DIGITALWRITE ( un impulso digitale in uscita) e quindi ha senso accendere e spegnere velocemente il segnale in uscita
per crearsi una frequenza personalizzata.

hai due alternative:
1- usa il pwm con analogWrite ma aumenta i tempi di attesa (prova 1-2 secondi = 1000 2000 ms)
non so se però questo funzionerà...credo di si, ma non ne sono certo al 100%

2- sostituisci analogWrite con digitalWrite come nell'esempio di tom igoe
  digitalWrite(servoPin, HIGH);   // Turn the motor on
  delayMicroseconds(pulse);       // Length of the pulse sets the motor position
  digitalWrite(servoPin, LOW);    // Turn the motor off
  delay(20);                      // 20 millisecond delay is needed between pulses

spero ti aiuti
ciao
b.
43  Forum 2005-2010 (read only) / Italiano / Re: freuenza massima di acquisizione on: January 07, 2007, 06:07:00 pm
anch'io sto avendo problemi con la velocità di acquisizione..
io al contrario tuo non sono riuscito a spingerlo fino a 115200 ... mi bugga già sopra ai 38400

una cosa però l'ho scoperta
la routine Serial.print() ciuccia circa 30 microsecondi
il che moltiplicato per 100 (il numero del tuo ciclo for) fa circa 3000 microsecondi quasi 1/3 di secondo.

se togli dal ciclo for la Serial.print()
e differisci registrazione in una stringa e serializzazione dopo il ciclo for, magari qualche misura in piu la riesci ad ottenere...
il mio dubbio è: ce la fa a fare una stringa di 1000 char??? smiley

bhò!? smiley
44  Forum 2005-2010 (read only) / Italiano / Re: c'e' qualcuno? on: February 03, 2006, 06:33:08 pm
caro Massimo,

ci sono e batto un colpo...
vediamo chi altro c'è smiley-wink

ps. complimenti per la nomina al prix ars electronica

a presto
b.
45  Forum 2005-2010 (read only) / Italiano / Re: consiglio dove acquistare componenti on: February 07, 2007, 11:46:51 pm
hehehe benvenuto nel magico mondo dell'interaction design smiley-wink
sono un designer anch'io e conosco perfettamente quel "gusto" di cui parli
buon tinkering
ciao
b.
Pages: 1 2 [3] 4 5 ... 9