Show Posts
Pages: 1 ... 9 10 [11] 12 13 ... 15
151  Using Arduino / Programming Questions / Re: Error Detection/Correction Code on: July 16, 2012, 10:45:30 am
no reference, but you might create something that does do lets say 10.000 re-writes of the entire memory.
Some fast filling and some near random filling (butterfly test),
i think for a best result you write something like below each time over the same memory field

10101010
01010101   
11110000
00001111
11111111

you might read the value before write (check if its correct) and do an OR function for the next write.
Note it takes a lot of time (or much radiation) to see some efffects.
Besides depending on the micro controller, the inner working the stack, the logic testing might be harder to do.
You need some code to do different types of logical unit testing (math / memory operations).
And be sure to check if the device is still functioning (I/O ports) AD/DA converters.
Do clock speed measurements, if the board contains other electrical units Condensators, transistors, elco's, diodes / zenerdiodes they could be affected too, and cause problems for the micro processor.

.. assuming your building something space related, it might be an idea also to check for shielding.
   once you know what shield type is enough, to keep if safe for humans, you less depend on microcontroller testing.
152  Using Arduino / Programming Questions / Re: [HELP] Running 2 programs at once. on: July 12, 2012, 08:53:09 pm

Code:
void setup{
i=0;
s=0;
r=0;}

void loop {
if ( i % 5 == 0 )
   {  s=1-s;
      if (s<0){digitalwrite (relight,HIGH); } else {digitalwrite (redlight,LOW)};   // define redlight pin in setup
                   }
if ( i % 100 == 0 )
 {  r=1-r;
    if (r<0){digitalwrite (greenlight,HIGH); } else {digitalwrite (greenlight,LOW)};   // define greenlight pin in setup
                  }
//delay below
//..
}

for sure this programs runs to fast to see redlight blink you add delay or use higer numeber after the %    .. i % 5000


just another way of doing it, based on modulo calculation



 
153  Using Arduino / Programming Questions / Re: Arduino Communication Crashes after some time Running on: July 12, 2012, 06:27:38 pm

As for your power suply concerns, archwelding sure is a problem.
Today i was also reading about PLC's they are more robust..
But looking at their schematics, i noticed they make heavy use of zener diodes
and for 'worse conditions' use optical connections so their main processors never get into contact with the electrical outside world.
But .. also.. their micro controllers, dont talk c++
well effectively neither does arduino (as c++ is compiled to machine code), both run machine code.
But it seams PLC's  are compared to arduino development.. surprisingly ... old (but proven) technology;  ladder diagrams.. instead of C++

but i'm drifting off
the main point their boards never make contact to the outside electrical world. optical couplers, or zenerdiode protectoin, or relays.
their boxes, inside metal cases (cave of Faraday against electric radiation (radio waves etc)).
If your from india.. it might pay of to build (and put to internet market a board that does do such electrical protection for arduino)
allready there is a rugged arduino version which has some more protection (but not all).. you might try them


for testing purposes.. just create a simple different program
that prints over serial an increasing number
and be sure that you keep recieving numbers
if it stops .. and it is simple .. and it doesnt stop at the maximum value for a varaible type
then sure it is electrical interference... if it is that.. buy another main arduino chip, (most likely it will becomme defective of such strange powers), be sure the arduino chip only has a bootloader >> check ebay to buy a new one.
dont use chips that where once damaged by electrical dis charge.  (those chips are cheaper then the boards) >> a good board has a chip that can be replaced (not soldered on the board) >> demilove or the rugged version  (uno is soldered not to prefer)

 

154  Using Arduino / Programming Questions / Re: Arduino Communication Crashes after some time Running on: July 12, 2012, 06:09:22 pm
what i tried to say is in simple
that your program has a counter delay that reaches 20
Your program will however often reach 20 and not once.

That might sound strange, just imagine it like this.
Code:
void setup{
byte i = 0;
Serial.begin(9600)};
void loop {
i=i+1   // a byte has a ma
serial.println(String(i)); 
}
if you run above program you wil get an output that keeps counting fomr 0 to 255, it never gets to 256 as byte cannt store that number it starts over (or crashes).

to set a delay to run something only once (and a bit in the style you did..)
Code:
void loop{
runonce=0;
}
void loop{
i=i+1;
if ((i==20)&&(runonce==0)) {
    //...do my stuff...     
    //...
    //.
    runonce =1;    // ensures this routine is never replayed again note arduino will reach this fast (miliseconds)
                        // you might as well put another AND to also check a pin for for a keypressed button switch, if you run without computer
    }                   // & = AND symbol looks a bit strange in this text editor

}


155  Using Arduino / General Electronics / stepper motor for arduino that doest require a driving board on: July 11, 2012, 07:05:07 pm
are there a stepper motors that can be directly attached to the arduino (multiple motors at once)
without a special shield or electronics besides perhaps some mosfets ?
as the while thing i want to build is based on USB power...  (a laptop on wheels, maybe gears and drive slower)
156  Using Arduino / Programming Questions / Re: Motors Library: Counting # of steps on: July 11, 2012, 05:25:22 pm
great to see people ask question, not that clear find "other" solutions, raise new questions and next solve them.

Perhaps enlighten us a little bit, what are you making ?, we wont need to see your code just out of curiosity

you use this more as a learning blog for yourself.
For questions be a bit more specific for people willing to help what you ask them.
i dont say its wrong or so but.. hm but i'm wondering how to respond to such type of blogging on the forum, as you didnt seem to need help.
 
157  Using Arduino / Programming Questions / Re: [Arduino Vs Android] Open accessory protocol problem on: July 11, 2012, 05:10:44 pm
Hm, if your new to this
in the code editor, did you configure the proper board to compile for and set the right com port; (and first installed the drivers) ?
Or else nothing will happen also.

I'm wondering so there must be now a google app to do com port communication ? (your talking to a pc comport here?)
i have a galaxsy SII, if it has a com port emulation app thats kinda cool smiley
158  Using Arduino / Programming Questions / Re: Arduino Communication Crashes after some time Running on: July 11, 2012, 05:01:28 pm
Maybe you didnt want this

Reading in your code i see contador ++ in your main loop
I guess you wanted some delay before calling that action if (contador>20)...
However note that adding +1 to a int value will go fine, until it reaches the maximum value of an int.
After that it simply starts over counting from zerro again  > and so you code to enable communication (and state check) is run again
not sure if you intended it but then  Comunicando = ~Comunicando; is called again too

did you want a small delay or is it okay to do this (because i'm not speaking the language its bit harder to see what you want).


It can also be that buffers on the computer side fill up (or data logging becomes to much, computer out of disk space, and computer becomes non responsive). Other option can indeed be, that power is not stable enough, both computer and arduino relay on stable power.
Zener diodes can give pretty stable power, wont protect i think for HF noice, Elco's can do that, magnetic on radio radiation is another thing.
if people do arch-welding nearby.. then thats terrible for electronics..
159  Using Arduino / Programming Questions / Re: declare 1 pin on 2 names on: July 11, 2012, 04:42:04 pm
well essentially
you set a variable name to 35 and you use it to refer to the 35th pin (arduino mega i guess it has lots of pins)
Variables can have the same name, i'd prefer logical small names, but you can call variables how you want compilers dont use these name in the final compiled code.

what you do next is saying that a certain pin number,   the pin number 35 as described by this variable ,  will be set to OUTPUT mode.

It is not forbidden to do so, in most programs its not practical.
There you just make a setup in which you define how the pins or ports (whatever you call them) should react.
But you can create program that sets pins on specific connected devices.

In such case you might as well use arrays, and use a while loop to set each pin for specific connected devices.
For example
array int Board1 [34,35,12,11,10'] // use a loop to set each port number 
array int board1 [  1,  1,  1, 0, 1]  // if value is 1 set it as output, 0 for input, ...

i use this sometimes to set many specific pins for output.


Note you have to make something for selecting your board because if one board uses a pin for input and another for output.. then you cannt call them just right after eachother, then the last call on how you want to set the board will be the one that is active.

maybe use a serial connection read, (connected to a computer) listen for a board name, and then set the pins like that
once you have them set you wont do this again '(simply dont send it again)
depending on name create a
If (boardname =="yourboard"){ //do this routine for setting up pins};
boardname = "" ; //clear variable so line above wont run again.
160  Using Arduino / Programming Questions / Re: [Arduino Vs Android] Open accessory protocol problem on: July 11, 2012, 04:11:57 pm

i dont think these are yet for sale ? (and not even mentioned on this site)


161  Using Arduino / Programming Questions / Re: [Arduino Vs Android] Open accessory protocol problem on: July 11, 2012, 01:22:44 pm
Wow you have a googleIO developers day android bord   !! ??  (how did you get it?)

see http://reviews.cnet.com/8301-19736_7-20061529-251.html
the forum is pretty silent about future arduino development boards, i assume its a next level board type.
If you went to google's IO days, didnt you got a CD with programming samples ?

162  Using Arduino / Programming Questions / Re: Convert String to int on: July 11, 2012, 07:08:39 am
Code:
int convert (string x) {
  int n = 0;
  char c= " ";
  for (int i=0;x.length;i++){
    c = x.charAt(i);
    n = n*10;
    n = n +int(c)
  }
return n;
}

or simple  n= int(string); wont work ??
163  General Category / General Discussion / arduino in space... ! on: July 11, 2012, 06:38:08 am
I was reading this story
http://www.wired.com/geekdad/2012/06/firefly-controller-board/

its a bit above my budget.. but its kinda cool
so.. if you can program an arduino..
your now a potential satellite programmer..


 smiley-lol How does it feel to be a rocket scientist?  smiley-lol
164  Using Arduino / Project Guidance / voice for arduino on: July 10, 2012, 07:54:39 pm
i've been wondering if voice would be possible for arduino.
by using a fractal as a generator for a pwn pin (0..255) output for voice singnal

i'm not deeply into fractals, but i like to drop the idea here

Words can be split up in phonons , small vocal parts.
there are too many of them to store on an arduino's memory
thats where a fractal can come in handy give it a start and an end number and it will produce a pattern
my thinking is (wrong or not?) that eventually a fitting patern for each phonon could be found
and thus a phonon can then be described in a start number and end number of the fractal function

main problem.. the right fractal for the task  / another computer prog to find the phonoms inside the fractal
165  Using Arduino / Programming Questions / Re: Motors Library: Counting # of steps on: July 10, 2012, 06:40:44 pm
not sure how your program looks like
if one cycle takes 55 steps and you have a loop for it somewhere after each loop increase a counter cycle

if it is based on the loop with an ever increasing counter
then there is the modulo function   --->    %

if( counter % 55==0){cycle++;}
Pages: 1 ... 9 10 [11] 12 13 ... 15