Show Posts
Pages: 1 ... 29 30 [31] 32 33 ... 75
451  Using Arduino / Project Guidance / Re: Resistive fabric + buzzer on: March 09, 2013, 06:52:17 am
Hi Jonathan, and welcome to the forums

Do you have a sensor in mind for this?  I'm not sure what you mean by resistive fabric, so if you have an example that would be great.  But if you have the sensor sorted out then the rest of what you're looking to achieve is quite simple to do with any Arduino, including the lilypad or flora types. 

Do you need it to be active for 15 minutes then wait an hour before being active again, or do you have a need for it to know the time so it will start at a particular time relative to the hour?  If the 2nd, Arduino doesn't know the time itself so you'd be looking to add a RTC (Real Time Clock) module.  If it's just elapsed time since the most recent trigger that you need to act on, Arduino can do that without additional hardware.

There is an Arduino IDE for Mac so you're good to go.

Cheers ! Geoff
452  Using Arduino / Project Guidance / Re: Arduino Programmer (FTDI) Questions on: March 08, 2013, 11:34:18 pm
Interesting. Sounds like grounding it is a good idea though. Will do that ongoing.

Thanks
453  Using Arduino / Project Guidance / Re: Arduino MEGA + 2 Liquid Crystal screen on: March 08, 2013, 08:20:03 am
Hi

The answer to this is - mostly, yes - but it depends.  Which displays do you have in mind, and will they be displaying the same or different information to each other? 

Geoff
454  Using Arduino / Project Guidance / Re: Arduino Programmer (FTDI) Questions on: March 08, 2013, 08:02:41 am
Hi Nick

From your other diagrams I've always left CTS without connection but in this one you've got it bridged with GND.  I don't think I've had any issues - but is there a benefit I'd be missing by leaving it disconnected or floating?

Cheers !
Geoff
455  Using Arduino / Project Guidance / Re: A little help with my LF robot on: March 08, 2013, 07:56:17 am
Hi,
1. What voltages do sonars like that usually work? Is it okay if I give it 6V, or do I need to add a 5V voltage regulator for it?
Could you help me powering all the components? I don't really know how much current can the arduino give :-?
Presuming the ultrasonic sensor is the HC-SR04, the datasheet says it uses 15mA at 5V.  Since the Arduino is able to power 20mA per pin, and that has a regulated 5V supply so that sensor will be able to be powered and run directly from the Arduino.
2. Should I use the L293D integrated motor driver or use the H bridge from the right? (I just have no idea what transistors to buy for it..)
That's entirely your call, but if you can stretch the budget to something prebuilt that will remove one potential set of headaches from your future.  Once again you'll need to consult the datasheet for the L293D to ensure that it has the capability to supply enough power to control the motors you're using.  There are beefier alternatives out there if not.
3. Someone told me that I should use Eagle instead of Fritzing - for PCB layout.. does it worth the switch..?
That depends...  Fritzing is easy to use, and has a PCB manufacturing service at the end of the process and if you're looking to produce quick images of a breadboard with your circuit laid out on it, you get that too.  Eagle makes great looking schematics, has loads of parts available in libraries available from a bunch of sources online, and can create the gerber files for sending to a wide range of PCB fabricators.  It does have a steeper learning curve, but it's a far more capable design product.  It has a huge ecosystem of plug-ins to expand its capabilities too.  Depends if you need to add another big learning curve to the one you're already due to face with this project in my view.  If you're wanting to use a PCB fabricator other than the Fritzing guys, I am not certain their software can do that...  At the end of the day there's nothing to stop you using both - the price is right after all smiley

Hope that helps,
Geoff
456  Using Arduino / Project Guidance / Re: How to Create logic on: March 08, 2013, 07:38:58 am
Read the reference section!.
Specifically look at the digitalRead() and digitalWrite() functions.  If you're familiar with other microcontrollers this should get you on the way.  As Mark mentioned above delay() might not be ideal for your project as it is a blocking function - your code will mostly not respond to external inputs while it is running.  I wouldn't go so far as to say never use it, but it's rare that it's the best choice for anything more than the most simple cases.

If you are completely unfamiliar with Arduino there are some excellent tutorials available not just here, but also on youtube.  This series by Jeremy Blum is a good place to start imo.

All the best,
Geoff
457  Using Arduino / Microcontrollers / Re: Arduino doesnt seem to boot when powered externally on: March 07, 2013, 02:49:39 am
Hi
but with my wireless sketch wont boot, can this still be a problem with power adapter?
It doesn't sound likely, but without sharing your wiring and sketch it's hard to know what it is doing.  For debugging it's sometimes worth keeping a visual pulse in your project - so using the blink without delay method to have an LED flash every second will let you know the microcontroller is active, even if the rest of the sketch and hardware is not responding the way you expect.  That would be my first item to add.

Once you do that you'll know if it has booted, but on the evidence the blinky sketch does what you expect under external power, I think you can presume that the Arduino is all good on a wall wart, and start looking elsewhere for the issue.  If the power LED doesn't come on when the wireless hardware is connected this can be an indication you have a short (there's a resettable fuse that will take the power away from the Arduino to protect it).  If you have a power LED but the sketch isn't doing what you expect, start from the basics and build it back out until you find the bit that's failing.

And if you get stuck, by all means come back here - but do post your code and a photo of the hardware too.

I do recommend a pulse LED if you have a spare Arduino pin though.
Geoff
458  Using Arduino / Microcontrollers / Re: Arduino doesnt seem to boot when powered externally on: March 06, 2013, 06:38:39 pm
A further thought - if it's not an Arduino Uno but an older model, not all automatically select the power source.  I have an Arduino that needs to have a jumper changed to select the power source being the 2.1mm DC jack.  An Arduino Uno should (I think all models) auto-select the power source.

Geoff
459  Using Arduino / Microcontrollers / Re: Arduino doesnt seem to boot when powered externally on: March 06, 2013, 06:34:34 pm
Hi

I presume you've got an Arduino Uno and the external power is via the 2.1mm power socket?  If not please shout out as the rest of this will be based on that assumption.

I indeed googled up that one and someone suggested 10k resistor from rx to tx  and I tried , didnt work.
Don't do that.  I can't imagine why that was considered a good idea.  On the plus since it's not a dead-short you are unlikely to have smoked anything.  Rest assured putting a resistor between RX and TX is not a normal requirement - so take that out and maybe don't listen to that someone so much in future  smiley  

There is nothing in the Arduino that makes it need a serial connection - unless you make that happen in your code - it's common to use those pins for purposes other than serial comms in fact, or for there to be no serial communication at all in a sketch, as it is with the blinky example you cite.

On the question of the serial monitor being open, the Arduino also doesn't wait for comms to be confirmed so if you don't open the serial monitor and there are Serial.println() etc in your code, they will just happen and be lost if there's nobody/nothing listening.  You can send as much as you like without anything connected on the other side and the Arduino is fine with that...unless you code it to do so.  Same goes for data sent to the Arduino - unless you're specifically looking for it it will be ignored.

Opening the serial monitor does reset the Arduino though, so your sketch will be restarted as a consequence.

Are you suggesting the blinky LED sketch doesn't start when you run it from external power without the USB plugged in?  If so, does the power on LED come on?  What you're describing sounds to me to be a power issue with your wall wart.

Cheers ! Geoff
460  Using Arduino / Microcontrollers / Re: which board do I have?? on: March 05, 2013, 04:24:57 pm
Hi,

Arduino Duemilanove was the model prior to the Uno and they're still commonly made & sold.  Check here for more specs.  It is very close to the Uno in spec, but has different hardware for the USB interface. 

Cheers ! Geoff
461  Using Arduino / LEDs and Multiplexing / Re: Help with LED Lamp concept. on: March 04, 2013, 12:18:07 am
(strykeroz, I'll back out of this discussion to avoid creating any confusion.)
Please don't.  There's always multiple ways to skin a cat in code  smiley
462  Using Arduino / LEDs and Multiplexing / Re: Help with LED Lamp concept. on: March 03, 2013, 11:39:06 pm
(looks like we were both posting at the same time Skorn - FWIW here's my thoughts)

Kculm,

You have a break statement inside your loop now and it's not tied to a result from a switch read - it just breaks the loop each time - therefore that loop won't have a chance to complete the transition.  What Skorn posted was that you could have a function to read the switch and act on it, that would also fire off the break statement if a switch press were detected.  Since val and val2 are global in your code, you can do this by giving your button function a return value, something like this:
Code:
boolean Button() {
   val = digitalRead(switchPin);      // read input value and store it in val
  delay(10);                         // 10 milliseconds
  val2 = digitalRead(switchPin);

  if(val == val2 && val == LOW) return true;
  else return false;
}
Then, in your traverse loop it looks something like this:
Code:
 // Now just loop through the path, traversing from one point to the next
  for (int i = 0; i < 2*MAX_PATH_SIZE; i++)
  {
    // !! loop index is double what the path index is as it is a nybble index !!
    v1 = v2;
    if (i&1)  // odd number is the second element and ...
      v2 = path[i>>1] & 0xf;  // ... the bottom nybble (index /2) or ...
    else      // ... even number is the first element and ...
    v2 = path[i>>1] >> 4;  // ... the top nybble

    traverse(vertex[v2].x-vertex[v1].x,
    vertex[v2].y-vertex[v1].y,
    vertex[v2].z-vertex[v1].z);
   if (Button()) break;      // <-- this replaces the two lines currently at the end
  }
Can't vouch for the rest of the logic, but this should step you forward some.

Cheers ! Geoff
463  Using Arduino / LEDs and Multiplexing / Re: Help with LED Lamp concept. on: March 03, 2013, 04:17:40 pm
Hi

Let's see if I can tell you this in a way that makes sense.  Apologies if I fail first time  smiley

The problem isn't the delay, the problem is the for loop that's in the RGB function.  What happens with all the other states is you test the switch and do something then immediately return to loop().  With RGB though, there's that for loop which traverses from one colour to the other.  While the code is in that loop, you're not testing the state of the switch so it gets ignored.  When the traverse is complete it will come back to loop() to start testing the switch again.  There may be more wrong with this logic, but that's the first that hits me.

One solution would be to check for the button state each time around that for loop, but that's not the way I'd do it.  Rather than duplicating the switch testing code, make RGB not complete the entire loop before returning, but just complete one more step in the traverse.  That way your logic will return to loop() to test your switch value and exit from the traverse if needed in between each step. 

Hope that makes sense, Geoff
464  Using Arduino / Microcontrollers / Re: Code not working with ATTINY 85 on: March 03, 2013, 08:09:51 am
Hi,

What exactly does it do on the ATTiny?  Also could you post a photo of your circuit so we can verify your connections?

Geoff
465  Using Arduino / Microcontrollers / Re: ATtiny..... Is it really that simple? on: March 02, 2013, 05:44:26 pm
Yes. Just as easy as that.  I find in standalone projects I use far more than ATMega uC's. With the bonus they are lighter, smaller, cheaper as well as simpler...
Pages: 1 ... 29 30 [31] 32 33 ... 75