Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Sensors / Re: How to use multiple accelerometers on arduino MEGA through I2C on: August 07, 2013, 02:12:10 am
Hi Gaska,

It is possible, but you need a digital multiplexer in between your arduino and your sensors. I've read that that is difficult but doable. I went for a more easy solution instead.
I used 8 analog sensors with a regular multiplexer, this was good engough for me!

godd luck!
2  Using Arduino / Programming Questions / Re: SoftwareSerial example not working as expected? on: October 11, 2012, 03:57:45 am
In addition to that, I'm not certain that SoftwareSerial has been rewritten to take into account the mappings for the Leonardo. It may have been, it may not.

Forgot to mention, but i'm on a arduino Uno SMD.
3  Using Arduino / Programming Questions / Re: SoftwareSerial example not working as expected? on: October 11, 2012, 03:28:12 am
I'm not sure I see the difference.

Excuse me, typo. See my edit!
4  Using Arduino / Programming Questions / Re: SoftwareSerial example not working as expected? on: October 11, 2012, 02:36:46 am
a GPRS modem on a breakoutboard from linksprite:

http://www.linksprite.com/product/showproduct.php?id=187&lang=en

5  Using Arduino / Programming Questions / SoftwareSerial example not working as expected? on: October 11, 2012, 02:30:43 am
EDIT: I'm using a arduino Uno SMD version

Hi all,

If i use the sofwareserial example which comes with the arduino distribution (1.0.1 on windows 7, softwareserial version ?? ) the output is not as expected.

Code:
/*
  Software serial multple serial test
 
 Receives from the hardware serial, sends to software serial.
 Receives from software serial, sends to hardware serial.
 
 The circuit:
 * RX is digital pin 2 (connect to TX of other device)
 * TX is digital pin 3 (connect to RX of other device)
 
 created back in the mists of time
 modified 9 Apr 2012
 by Tom Igoe
 based on Mikal Hart's example
 
 This example code is in the public domain.
 
 */
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TX

void setup()  
{
 // Open serial communications and wait for port to open:
  Serial.begin(57600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  
  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(4800);
  mySerial.println("Hello, world?");
}

void loop() // run over and over
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}

if i input 1 2 3 4 5 6 7 8 9 (seperated) i get this response:

þþÿÿÿÿþþþ

if i change

Code:
Serial.write(mySerial.read());

to

Code:
Serial.print(mySerial.read());

the output becomes:

ÿÿÿÿÿÿÿÿÿ

which looks like a timing issue to me...

Anyone experience with this possible bug?
6  Using Arduino / General Electronics / Re: Will this fry my Uno? on: October 08, 2012, 09:56:48 am
Ok, will look into this,

thanks!
7  Using Arduino / General Electronics / Will this fry my Uno? on: October 08, 2012, 08:50:38 am
Hi all,

i want to hook my Uno to the RS 232 output of a vending machine. on wikipedia i read that output levels of RS 232 are typically +-5V, 10V and 15V. The maximum input of Arduino is 5.5V so i probably need to lower this voltage.

How do i do this?

Thank you
8  Using Arduino / Programming Questions / Re: How get this code to read strings over 9 characters from serial? on: October 04, 2012, 09:34:49 am
You're right with your comments, instead of correcting it I went for yours.

Thanks!
9  Using Arduino / Programming Questions / How get this code to read strings over 9 characters from serial? on: October 04, 2012, 05:20:00 am
hi all,

My code constructs string commands from serial input. However, the command is not picked up when the total length is longer than 9 characters.

How do i extend this?

Code:
String cmd;

void setup(){
  Serial.begin(9600);
  cmd = "";
}

void loop()
{
  serialReader();
}

void serialReader(){
  int makeSerialStringPosition;
  int inByte;
  char serialReadString[300];
  const int terminatingChar = 13; //Terminate lines with CR
 
  inByte = Serial.read();
  makeSerialStringPosition=0;
 
  if (inByte > 0 && inByte != terminatingChar) { //If we see data (inByte > 0) and that data isn't a carriage return
    delay(10); //Allow serial data time to collect (I think. All I know is it doesn't work without this.)

    while (inByte != terminatingChar && Serial.available() > 0){ // As long as EOL not found and there's more to read, keep reading
      serialReadString[makeSerialStringPosition] = (char) inByte; // Save the data in a character array
      makeSerialStringPosition++; //Increment position in array
      //if (inByte > 0) Serial.println(inByte); // Debug line that prints the charcodes one per line for everything recieved over serial
      inByte = Serial.read(); // Read next byte
    }

    if (inByte == terminatingChar) //If we terminated properly
    {
      Serial.println("command received");
      serialReadString[makeSerialStringPosition] = 0; //Null terminate the serialReadString (Overwrites last position char (terminating char) with 0
      cmd = serialReadString;
      Serial.println(cmd);
    }
  }
}

Thank you!
10  Topics / E-Textiles and Craft / Re: Small powersource based on motion needed! on: September 07, 2012, 12:42:55 am
Ever ride a bike? The answer here is no, because you would not be generating anything if you were coasting down a long hill unless you pedal constantly. Who wants to have to pedal going downhill?  smiley-wink

Here, we don't get to go downhill (or uphill for that matter).

Thanks for all the input, i'll go for a regular dynamo, it would need to power an arduino as well....
11  Topics / E-Textiles and Craft / Re: Small powersource based on motion needed! on: July 28, 2012, 05:42:51 am
Bicycles have had dynamos for decades. Why not use one of them?

http://en.wikipedia.org/wiki/Bicycle_lighting#Dynamo_systems
because i want to avoid wiring over the bike smiley-wink

After some thought, an alternative came to me.  Why don't you just use the bike chain to rotate a small generator/alternator?
Do you think that would produce less friction than a dynamo on the tire? Definitely something worth looking into!
12  Topics / E-Textiles and Craft / Re: Small powersource based on motion needed! on: July 27, 2012, 01:39:38 am
I would be surprised if a bicycle that stays upright would have enough sideways motion to generate useful power for a light.  Please let us know what you find when you start testing.

i'm hoping for the sideways motion when you're accelerating. The primary target group are those fixed gear track bikes. But i'll let you know if anything comes out!
13  Topics / E-Textiles and Craft / Small powersource based on motion needed! on: July 26, 2012, 02:04:12 am
Hi all,

Dunno whether this is the right place to ask this but i'll give it a try.

I want my bicycle light to be powered on the sideways motion of my bike. For this i would need a device which is also in 'automatic' watches like the seiko kinectic (they do not require battery but winded up by the motion of the wrist).

Does such a thing exist in electrical form (the watch version being mechanical)? And if so, would the power be large enough for a LED to burn?

Thank you! 
14  Using Arduino / Programming Questions / How to write newline to sdfile? on: July 04, 2012, 01:33:21 pm
Hi all,

i try to write sensor values to a line in a SD file, i use sdfatlib. It works OK.
But: i want to write a newline ("\n") every 5000 characters.

I thought of doing:

Code:
if (str.length() > 5000){
   sdfile.print("\n");
}

but it does not work very well. Which character should i use?
15  Using Arduino / Project Guidance / Re: Timer for sound installation on: June 27, 2012, 02:47:05 am
Indeed, using an arduino with a RTC (realtime clock) module would be your cheapest option (< 30 euro /dollar). Gives you more freedom as wel.

Just calculate the periods you want your device in terms of seconds since 1-1-1970 and have your code poll every minute orso whether such a period is begun. You do need to power the arduino of course. But maybe you can do that from the solar source?

a tut: http://www.ladyada.net/learn/breakoutplus/ds1307rtc.html on to build your own

but you can also get these module preassembled http://www.sparkfun.com/products/99
Pages: [1] 2 3 4