Show Posts
Pages: 1 ... 43 44 [45] 46 47 ... 82
661  Community / Bar Sport / Re: Your latest purchase on: June 04, 2012, 06:08:57 pm
Bought a 3D print at Shapeways.com - just a tiny test shape. The picture shows the same shape done on the now rather old MendelRepRap at the club, and another done on a friends Ultramaker. You may guess which is which smiley Price info:
500$ machine
20¢2000$ machine
10$ plus shipping50000(?)$ machine
662  Using Arduino / LEDs and Multiplexing / Re: general question: NxM RGB LED matrix with PWM on: May 23, 2012, 03:10:21 pm
Why is everyone using additional hardware like shift registers od led control ics?
Shiftregisters: Because there are not enough pins on the Arduino. LED control:For good LED control you want constant current. (More reasons below)

M Digital IO pins for the cathodes (my case 10) and N*3 PWM pins  (my case 9)
I can not see any obvious flaws in that argument. Remember that you still need a transistor/FET on all (your case, 19) lines - the  microcontroller can NOT give enough current. Worst case the top transistor/FET needs to cope with 10 LEDs (about 0.5 A, maybe 1 A depending on your LEDs) the bottom transsitor likewise.

As far as i have read one scans the whole matrix row by row (M=10). Inside the active row one scans again over all leds (N*3). What scan times can i expect from an arduino mega 2560 and how do i calculate it?
Each LED can at most only be ON a 10th of the time, when you scan the rows. You can then parallel control your 9 column lines. Or the other way round. You define the scan rate, as fast as possible to avoid flicker, ie 100Hz+. The standard PWM runs at 400Hz, so you may get odd "beats" between your scan rate and the PWM. An LED ic will do the PWM at a higher rate, and you can tweak the Arduino core likewise.

To get the LED to seem bright enough, when the scanning limits it to a 10th ON, you can overdrive it so the "average" is within specs. The circuits get a little tricky, you dont want the overdrive to happen if the program stops and one row remains lit ... so the LED ics are nice.
663  International / Scandinavia / Re: arduino uno alarm on: May 21, 2012, 04:32:16 pm
Velkommen til!

Når du læser lidt af de andre indlæg, så kan du se at du er nødt til at fortælle lidt mere end kun "nemt og hurtigt alarm".

Hvad er den "nemme" del : Konstruktion? Kredsløbet? Softwaren? Brugen af det?

Men begynd med at fortælle
1) Hvad det er du overvåger (temperatur, vandniveau, antal fodtrin på et følsomt område)
2) hvordan du måler det (eller har tænkt at måle det, sensor type)
3) Hvad alarmen består af (blink, lyd, mail, SMS ...)
Og måske hvorfor du mener du behøver en Arduino involveret (kompliceret niveau/antal sensor input, kompliceret alarm (sende en SMS))

(Istedet for en lang beskrivelse kan du attache en tegning, muligvis en indscannet en)
664  Using Arduino / Programming Questions / Re: Branch To Subroutine on: May 06, 2012, 11:02:00 am
On a standard Arduino pin 0 will not work as an interrupt, only pin 2 and 3. So your interrupt is never activated, never setting resetP to 1, thus never satisfying the if to call your subroutine.
665  Using Arduino / Programming Questions / Re: Branch To Subroutine on: May 06, 2012, 10:57:13 am
Subroutines are called, not branched to.

There is nothing in your description as to why it should not be called.

Looking inthe attached code, I am missing a few #includes (or the other *.cpp in your directory) to get it to compile. That way I could see if you have mismatched a bracket or two.

You only go into your reset code if the interrupt on pin 0 triggers. Which never happens as I mention further down.
666  Using Arduino / Programming Questions / Re: Ardiuno UNO, a4983 driver and stepper motor on: May 05, 2012, 07:57:52 am
Swapping the 4-wire is a good try, assuming the chip is controlled correctly. It is enough to just swap any (adjacent) pair of motor wires.

Code suggestion (your actual pinnumbers and values may vary)
Code:
const int Mdir=6 ;
const int Mstep=7 ;
 :
pinMode(Mdir,OUTPUT) ;
pinMode(Mstep,OUTPUT) ;
 :
digitalWrite(Mdir,HIGH) ;  // LOW to go the other way
for (int j=0; j<200; j++) {
  digitalWrite(Mstep,HIGH) ;
  delayMicroseconds(12) ; // Step occurs on rising edge
  digitalWrite(MStep,LOW);
  delay(3) ; //  more delay-> slower rotation speed.
  }
Lastly, if you use delay() you are blocking, that is, the Arduino wont be able to do other things, like watching if a button is pushed, whilst turning the motor. That is also how the stepper-library works. If that is good enough, fine. Otherwise you have to start reading about "avoid using delay". Here and here and lots more from other contributors.
667  Using Arduino / Programming Questions / Re: From float to seperate INTs - in an elegant manner :-) on: May 05, 2012, 07:29:28 am
Damn, you're right ! smiley Didnt test it. The cause is that 24.8 is (probably) internally stored as 24.7999999... due to the finite limit of representing decimal fractions in binary.

Well, in an effort to keep my pride intact smiley-wink and to keep it "elegant" use the round function for the last bit
Code:
c=round((f[n]-int(f[n]))*10) ;
668  Using Arduino / Programming Questions / Re: Ardiuno UNO, a4983 driver and stepper motor on: May 04, 2012, 04:04:54 pm
The stepper library does not know that you have an a4983. It is toggling the pins alternatly, thinking there is a motor. As one of the pins is the "dir" pin on the chip, your motor just jiggles to and fro.

Control your pins directly. Leave the pin going to the "dir" high and then alternate the the "step" pin up and down with a delay.

(I'm sure someone has made a library, but it is just a 3 line program to control the motor through the A4983.)
669  Using Arduino / Programming Questions / Re: From float to seperate INTs - in an elegant manner :-) on: May 04, 2012, 03:52:28 pm
Code:
float f = 24.8 ;
int a ;
int b ;
int c ;

a = int(f)/10 ; b= int(f)%10 ; c=int((f-int(f))*10) ;
670  Using Arduino / Programming Questions / Re: An error is causing my code to work! Bizarre... on: April 24, 2012, 12:17:57 pm
Editing of posts after people have discussed in several following posts them makes reading the thread very hard as they refer to something no longer there. Keep the edit feature to minor typos or suchlike.

Back to the subject: The code as I read it at this moment you declare two variables with the same content. The setup code does: Set pin to Input, Write High to pin, set pin to Output. The loop then reads the output pin. Reading an output pin "should" return the last value written...(similar case) which is HIGH.

If we leave out the 2nd defenition, or rather change (to avoid the undefined compiler error) then the code is
Set pin to input, Write high. The code then just reads the input pin.

You claim the exact opposite is happening. Have I understood you correctly?

I tried your code on my Arduino and it works for either case. Here is my code (which I will not edited after posting smiley )
Code:
const int FrontDoorPin = 4;
const int relay = 4;  // changed to 11 .. still works

void setup()
{
  pinMode(FrontDoorPin,INPUT);
  digitalWrite(FrontDoorPin, HIGH); //pull up
  pinMode(relay, OUTPUT);   
}
void loop()
{
  if (digitalRead(FrontDoorPin) == LOW)
    digitalWrite(13,HIGH) ;
  else digitalWrite(13,LOW) ;
}
I even listed the assembly output and there is no "funnies" about the compiler getting confused or optimizing something away.
671  Using Arduino / Programming Questions / Re: Stepper motor repeat/interupt code on: April 23, 2012, 05:51:11 am
Switches...
Code:
if (mode ==0 && digitalRead(setupAswitch) == LOW){ mode = 1;}
will read the reed smiley and only switch into mode 1, from the startup state. Nice code. That part works. And it will not be confused with button bounce.
Code:
case 1:  // Set Stepper start position A
//Rotate until reed switchA is LOW
mode = 3;
break;
I presume that is a place holder for now, 'cause mode 3 does nothing, exect allow us to move onto mode 4&5 on the next pass of the loop. (approx 10-odd microseconds later.)

Similar to the case 4, we test the condition for leaving mode 1, and if not do something in mode 1. (I really want you to find the solution yourself smiley )

The test will be digitalRead(reedswitchA), and on to mode 3 else do a Stepper.step and delay a while. (if it is +1 or -1 is your choice)
672  Using Arduino / Programming Questions / Re: Stepper motor repeat/interupt code on: April 22, 2012, 12:10:52 pm
The solution depends on if you need to run loop() during the initial sequence (f.ex. to blink a LED, move another motor or check a temperature meter)

If you only need to do this motion then something like
Code:
case 4: // Run Stepper Prog A
 for ( int c=0; i<500; i++) {
   myStepper.step(1);
   delay(6000);
   }
mode = 6;
break;
would work BUT this means that the machine does nothing else for 50 minutes.

If you need to monitor - fex. an quick stop switch - then

Define variable CountA, set it to 0

In case 4 fix the last line to be
  if ( CountA++ >500 ) mode = 6 ;

This way the code will (as long as the first 4 lines do not change it) repeatedly do case 4 for each loop() pass, until it has executed 500 times.
673  Using Arduino / Motors, Mechanics, and Power / Re: Power supply on: April 20, 2012, 12:12:39 pm
$200 for the controller -  smiley-eek

Ehr ... apart from the Voltage/current which fit, was it something particular you were worried about?

I would think it was harder to specification-match that controller to the steppers you have.
674  International / Deutsch / Re: 2 Stepper per Joystick steuern on: April 20, 2012, 12:02:36 pm
Das beispiel unter Exmaple Steppers MotorKnob tut es. Ein pot ein Stepper. Brauchts bloss den kode vier-faltig einlegen ...
675  Community / Bar Sport / Re: Raspberry 3.14159265.... a first review on: April 20, 2012, 11:54:36 am
... people do not regard the UK as Europe, in the rest of Europe as well as in the UK. Why we are in the EU I will never know, it is all down to the Germans wanting revenge for loosing the war.
No it was the French who needed someone to pay for their ridiculuos farmer subsidies. smiley

signed one who has lived 10 years in UK, 6 years in DE and 10 years in SE and quite a lot in DK not in that order ...
Pages: 1 ... 43 44 [45] 46 47 ... 82