Show Posts
Pages: 1 ... 424 425 [426] 427 428 ... 580
6376  Using Arduino / Project Guidance / Re: Arduino controlled tube bending controller on: May 20, 2011, 10:20:56 am
You've might have to be careful how many you drive at the same time. The absolute max for each VCC and GND pin is 200mA, but given that there's 4 or 5 of each on a Mega I don't know if that means 4 or 5x 200mA or not.

______
Rob
 
6377  Community / Exhibition / Gallery / Re: Modular Stackable Microcontroller System (lots of pics) on: May 20, 2011, 07:21:49 am
I've done the backplane address thing in the past and it works well enough.

One thing I don't like about that system is that all the addressing changes if you decide card X should be one slot to the left, so all the other cards move up one.

How about a combination of the two approaches.

Every micro-based card has an address in EEPROM that is null to start with. If that value is null the card gets the address from the backplane, if not it uses the EEPROM version.

So cards can spend their life using the backplane address, but if you want some stability you have a utility that tells it to write an address into EEPROM.

Backplane addresses are < 16, EEPROM address 16 to 255 (or whatever).

______
Rob
6378  Using Arduino / Sensors / Re: pressure sensitive button - on: May 20, 2011, 03:18:00 am
And linear pots, depending on how much travel you need.

______
Rob
6379  Using Arduino / Programming Questions / Re: Simple timed serial event on: May 19, 2011, 11:25:08 pm
Something like this.

Code:
loop () {

   static long LastDataRx;

  if (Serial.available() > 0) {
      Serial.flush(); // assuming you don't care what the data is, just that there was some
      LastDataRx = millis();
   }

   if (millis() - LastDataRx >= 1000) {
      doSomething();
   }

}

Rather than flush the data it would be better to at least test for a valid character if you have control of the transmitted data and/or know what to expect.

_____
Rob
6380  Using Arduino / Microcontrollers / Re: Similar Microcontrollers to Arduino/Atmega?? on: May 19, 2011, 11:20:16 pm
The Picaxe is a good system but it's nowhere near as versatile as an AVR or PIC, mostly because of the interpreted BASIC. That arguably makes it easier to use for a beginner but also limits what it can do.

However you may not reach those limits, it depends on what you want to do. I've seen some pretty fair projects done with Picaxes.

______
Rob
 
6381  Using Arduino / Programming Questions / Re: How does serial handle data. on: May 19, 2011, 07:25:17 pm
Quote
using a wiimote
I have no idea what these are capable of, can you program it to send whatever characters you like?

______
Rob
6382  Using Arduino / Sensors / Re: ADS1252: Tutorial on High precision (24-bit) ADC on: May 19, 2011, 10:15:48 am
Any more news on using this chip?

______
Rob
6383  Community / Exhibition / Gallery / Re: Modular Stackable Microcontroller System (lots of pics) on: May 19, 2011, 06:43:27 am
Quote
thats it so far.
Is that all?

Wow, like I said when saw the 3d mockup, I get vertigo just looking at it.

The other day you said you got the 1284 bootloader working , was that at 18.432Mhz?

Quote
4 bit DIP's for addresses on the boards with processors,
If the pins used for this go to ADCs you can use trinary encoding (albeit not with normal DIP switches) to get 64 addresses from 4 inputs or 27 from 3 inputs.

The photographer in me says you should have more depth of field in the shots smiley

Good job, it will take you another year to write all the software now.

PS: For industrial use I think you should ad RS-485 capability

______
Rob

6384  Using Arduino / Project Guidance / Re: Coin Counter on: May 19, 2011, 05:39:14 am
No matter how hard I try I just can't get that Aussie twang out of my variable names smiley

______
Rob
6385  Using Arduino / Project Guidance / Re: Arduino controlled tube bending controller on: May 19, 2011, 03:47:15 am
That's all quite doable.

1) A relay or IO board like Terry suggested.
2) You need to see if you can get access to the outputs of this encoder.
3) All simple.
4) Yep, an LCD.

Two things to think about.

Getting inputs from sensors/switches on the machine, that's a longish cable run in a noisy environment, I would not run Arduino inputs directly. Maybe isolate with opto couplers or at least harden them with a series resistor and clamping diodes.

The two safety mechanisms (SICK and palm buttons), try not to implement that functionality with the Arduino but rather leave them as is. I'm not sure how OH&S will view an non-certified program handling these functions. I'd hate the thing to fire up at the wrong time because your code has & instead of &&.

As for doing a PCB, there are many free PCB design packages, Eagle is probably the most common but you can only do boards up to (I think)  60x100mm with the free version.

______
Rob
6386  Using Arduino / Programming Questions / Re: How does serial handle data. on: May 19, 2011, 03:21:24 am
That's one hell of an if/else rats nest Mike, the variable you're testing against seems to have contiguous values which probably means an array or two can remove all the crap.

Actually, don't all those blocks do the same thing?

Can you spell out exactly what is supposed to happen?

Serial characters can't be received "at the same time" they appear one after the other.

Quote
Its part of a musical instrument and I need to make sure the solenoids are in time.
By directly manipulating the ports, but you shouldn't have to, two digitalWrites() in a row will appear to be simultaneous to a human. Even if there's a serial character in between.
______
Rob
 
6387  Community / Exhibition / Gallery / Re: Greenhouse automation on: May 19, 2011, 03:08:13 am
I think I've trimmed some more fat
Code:
  byte stats;
  byte previousstats;
  
   #define TEMP_RED_BIT B00000001
   #define TEMP_GREEN_BIT B00000010
   #define HUMID_RED_BIT B00000100
   #define HUMID_GREEN_BIT B00001000
   #define MOIST_RED_BIT B00010000
   #define MOIST_GREEN_BIT B00100000
  
  
  stats = 0;
  if((temperature < 22) || (temperature > 28)) {
    stats |= TEMP_GREEN_BIT   // green on
  } else {
    stats |= TEMP_RED_BIT;    // red on
  }
  //Humidity
  if((humidity < 60) || (humidity > 80)) {
    stats |= HUMID_GREEN_BIT   // green on
  } else {
    stats |= HUMID_RED_BIT;    // red on
  }
  //Soil
  if((moisture_val < 850) || (moisture_val > 1000)) {
    stats |= MOIST_GREEN_BIT   // green on
  } else {
    stats |= MOIST_RED_BIT;    // red on
  }
 
  ////Checks if update to control panel is needed
  if(stats != previousstats) {
digitalWrite(latch, LOW);
shiftOut(data, clock, MSBFIRST, stats);  // don't need the led() function any more
digitalWrite(latch, HIGH);
        previousstats = stats;
  }
  

You could also use the same arrangement but change the #defines to bit numbers and have bitWrites() instead of the &= and |= with bit patterns.


______
Rob
6388  Using Arduino / Project Guidance / Re: Designed an Attiny "BBB" type board, need input on: May 19, 2011, 02:45:52 am
It's starting to look good.

The 10k pull up resistor is a tad close to the DIP socket.

The holes for the DC barrel jack, they either have to be slots or WAY bigger than that.

2k2 is too large for the LED, although that doesn't affect the PCB layout.

______
Rob
6389  Using Arduino / Programming Questions / Re: storing int in byte-variable on: May 19, 2011, 02:06:42 am
Well cut of me legs and call me shorty, thanks AWOL, I learn something new every day, I was sure it would clobber a byte.

I just tried this

Code:
  byte x;
 int y = 1234;
 x = y; 

with -Wall, not even a warning. However

Code:
  byte x;
 int y = 1234;
 x = 1234; 

Gives "large integer implicitly truncated to unsigned type"


______
Rob
6390  Using Arduino / Programming Questions / Re: storing int in byte-variable on: May 19, 2011, 01:38:29 am
Firstly the compiler should throw an error.

If you force the issue you will clobber a byte on one side of the variable.

Is there a reason to do this?

______
Rob
Pages: 1 ... 424 425 [426] 427 428 ... 580