Show Posts
Pages: 1 ... 446 447 [448] 449 450 ... 579
6706  Community / Exhibition / Gallery / Re: Simple low cost homemade arduino box on: April 16, 2011, 09:04:35 am
he he, you're right that's an ugly box. I can't believe I just watched a 2.5 minute video of it. (Good to see you figured out now to lock the camera so you could put the USB cable in)

Not quite ready for product I'm guessing smiley

All jokes aside a box is a good idea, it's very easy to short the underside of a PCB if it's bare.
______
Rob
6707  Community / Website and Forum / Re: Down with polls on: April 16, 2011, 08:54:55 am
Why not have a poll to see if this is a popular idea smiley
6708  Using Arduino / Programming Questions / Re: array on: April 15, 2011, 11:30:03 pm
Code:
int pins[] = {1,2,3,4,5};  // for example

void setup () {
   for (int i = 0; i < sizeof (pins); i++) {
       pinMode (pins[i], OUTPUT);
   }
}

void loop () {
    digitalWrite (pins[4], HIGH);
    delay(100);
    digitalWrite (pins[4], HIGH);
    delay(100);
}


______
Rob
6709  Using Arduino / Programming Questions / Re: blink without delay brain problem on: April 15, 2011, 09:22:00 pm
Quote
do define the array msg as 4 in the setup, is that part of it?
That doesn't help, it merely tells the compiler how much memory to allocate but at run time that means nothing.

You can't use strlen() on it because the contents of msg is not a string, it's binary data.

You can use "sizeof (msg)" which is probably the best way to do it, but just for debugging use "4" to see what happens.

______
Rob
6710  Development / Other Software Development / Re: Arduino PID Library: Out of Beta on: April 15, 2011, 08:47:31 pm
Thanks br3ttb, I skimmed your tute and already know 10x what I used to about PID, I'll have a better read later.

______
Rob
6711  Using Arduino / Programming Questions / Re: sketch taking forever to upload (it verifies ok) on: April 15, 2011, 08:39:37 pm
For that matter get rid of it, the array values just track the index, so just use bit operations on the value.

______
Rob
6712  Community / Products and Services / Re: Phi-2 shield is out! Interactive LCD and keypad all-purpose shield on: April 15, 2011, 08:35:53 pm
Good on you liudr for getting things finished and actually on the market.

______
Rob
 
6713  Using Arduino / Programming Questions / Re: blink without delay brain problem on: April 15, 2011, 07:54:01 pm
I think there's a bug in this line

Code:
    vw_send((uint8_t *)msg, strlen(msg));     // send the character out
 

msg is not a null-terminated string so strlen will count until it finds a '\0', wherever that may be. I suspect you are transmitting 10s or even 100s of bytes.

Try

Code:
    vw_send((uint8_t *)msg, 4);     // send the character out

I haven't looked at the Rx code yet to see how this would be handled.
______
Rob

 
6714  Using Arduino / Programming Questions / Re: blink without delay brain problem on: April 15, 2011, 07:46:11 pm
Quote
so will you be "somewhere else in Australia" on your avatar tomorrow?
Yep, just moved 80k east to get away from the coast. Got better phone reception than we had 10k from town. Out here in West Aus that often happens, you can be 200k from any town but get perfect reception because there happens to be a mine nearby and they put in a tower for them.

Quote
and I get 232 out for T at the Rx end
Suspiciously similar to 1234, the 232 is HEX isn't it?

______
Rob
6715  Using Arduino / Project Guidance / Re: Master / Slave shared memory on: April 15, 2011, 10:23:36 am
All possible, you can buy dual-port RAMS (and even quad-port I think), but they are usually expensive.

You can DIY but something will have to sync the access, it can't be a free for all.

You could use a ATmega with external memory interface, but once again something has to arbitrate and as AVRs don't have any form of WAIT input I don't think hardware can do it.

One way may be for the master to provide an INT to the slaves one at a time, this tells them it's time to write.

To do this at hardware speeds you would need a LOT of octal buffers. You could do it all in software albiet with the very real chance of a major screw up if things go out of sync.

All in all I think it's more trouble than it's worth.

All the above refers to using parallel shared memory. It would be much simpler to implement something with say an SPI RAM chip. All uCs could be masters to the SPI but the master chip controls the slaves by dishing out interrupts to them.

It would need some more thought but once again it's hard to see that it's worth it.

PS there are also dual (and multi?) port serial RAM chips.
______
Rob
6716  Using Arduino / Networking, Protocols, and Devices / Re: Serial comm between 2 Arduinos (Now with XBee) on: April 15, 2011, 09:55:31 am
There are always a 100 ways to write code for a given problem, but here's one example that I think will do the same job.

Code:
  //                            RGB       RGB       RGB       RGB
  byte bit_patterns [] = {B00000000,B00000010,B00000100,B00000001};


void loop()
{
if(mySerial.available() > 0)
{
char val = mySerial.read();   
char b = bit_patterns[val - '0']; // note, no bounds checking, we could get a 'Z'

Serial.print("recieved:");
Serial.println(val); //Print what Arduino 1 is sending

digitalWrite(blueLed, b & 1);
b >>= 1;
digitalWrite(greenLed, b & 1);
b >>= 1;
digitalWrite(redLed, b & 1);
}
}

_____
Rob
6717  Using Arduino / LEDs and Multiplexing / Re: Demultiplexing with a 4067 problem on: April 15, 2011, 06:45:19 am
Quote
WHERE ARE THE CURRENT LIMITING DIODES ON THE LEDs?
I can't believe I didn't see that  smiley-red

______
Rob
6718  Using Arduino / Programming Questions / Re: blink without delay brain problem on: April 15, 2011, 12:34:21 am
Quote
its not consistent if thats any help
Nope smiley

I think you need to know if the problem is in the creation of T, in the sending or the receiving.

In this sort of situation I would normally start plugging in hardcoded values to do some module testing. IE, forget using T and send a known value.

msg[2] = 0x12;
msg[3] = 0x34;

If you get 0x1234 at the other end then maybe T is the problem. etc etc.

I just "follow the data" trying so see at what point it goes bad.

Is "msg" defined as 4 bytes/ints?

Also I've lost track of the current code now, can you post the lot again.

PS: I'm moving the truck (home) today, don't know if I'll have internet tonight or not.

______
Rob

6719  Using Arduino / LEDs and Multiplexing / Re: Demultiplexing with a 4067 problem on: April 14, 2011, 09:42:44 pm
Nothing wrong with the code or circuit that I can see, there are a few surplus {} in there but that won't do any harm I think.

How about forgetting the input logic and trying with hard-coded values to see if you have proper control independent of the pot position.

______
Rob



6720  Using Arduino / Project Guidance / Re: Need help with pin mapping, 328 to 644 on: April 14, 2011, 09:30:13 pm
They seem to have ignored the i2c pins WRT the shield and taken them to another header.

______
Rob
Pages: 1 ... 446 447 [448] 449 450 ... 579