Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 88
61  International / Scandinavia / Re: Nybörjare önskar hjälp med att styra ljus med MIDI-keyboard on: May 20, 2014, 04:35:57 pm
Kan man omskriva din projekt beskrivning til at du vil få en given Midi Note at aktivere en utgång på Arduinoen?

Så skal du "bara" få Midi-dataen (som er seriel) ind på en Arduino port (og jag är säker på att det står beskrevet i Midi librarien du använder om opkobblings kredsen) og en et relativ enkel program letar efter den Note kommando i data-strömmen och laver en lille digitalWrite.

När det program funker så kan man udvida det: Göra en upslag lista (Array): kommando - digital port der skal tändas/släckas.

Senere kan der sättas i gång sekvencer med en Note men så skal din programmering klara State-Machine og det er FORBJUDET att använda delay().

Men börja ved början - Midi in - leta efter en bestemt "Note On" - göra en DigitalWrite(13,HIGH) resp digitalWrite(13,OFF) och dermed bevis prototype-1.

Det spelar det ingen roll om det er en liten LED eller en 1000W strålkastare; du skal bare använda en passande transistor, MOSFET, SCR-gate, Relä eller SolidStateRelay för att forstärka den lille Arduino ström til noget större.
62  International / Scandinavia / Re: Goddag alle sammen - Jeres Arduino erfaring? on: May 20, 2014, 04:22:32 pm
Og hvad skal du bruge informationen til?
a) Beslutte om Arduino forumet er kvalificeret nok til dine spørgsmål?
b) Dem der svarer skal i hvert fald have et godt tilbud fra dig om dims D
c) du vil bare have lidt selskab, og skabe lidt gang i Scandinavian forumet ;-)
Og så har du ikke udfyld nogen af dine "fakta" i profilen (som lokation eller køn ...)

Men spørgsmålene er uskyldige nok:
1) 4+ år  2) Jeg skulle bruge en mikrokontroller at styre et par motorer med - se det skrinlagte projekt : 3) søg mit navn i Exhibitions forumet.
63  International / Scandinavia / Re: Katapult - Min første kode on: May 20, 2014, 04:18:22 pm
Antagligen har du prøvet om den compilerer og det er gået godt ?
//Including servo libaery
#include <Servo.h>

//Assaigning a name to the servos  <-- nej, det instantierer 3 "Servo objekter", så du kan styre 3 styks.
Servo servo_spring, servo_direction, servoer_blocker;

//Assining Potmeters pins
const int springPin = A0;
const int directionPin = A1;
const int blockerPin = A2;
const int firePin = 2;
const int releasePin = 3;

void setup(){
  //Servo Pin Assignment  <-- OG Initialising, and powering up the servos
  //pinMode OUTPUT
  pinMode(releasePin, OUTPUT);
  //pinMode INPUT
  pinMode(firePin, INPUT);
void loop(){

  //Spring Tension - Adjustment
  val1 = analogRead(springPin);
  val1 = map(val1, 0, 1023, 0, 180);
  //Direction - Adjustment
  val2 = analogRead(directionPin);
  val2 = map(val1, 0, 1023, 0, 180);  <-- Der røg det møjsomligt indsamlende directionPin værdi ud af vinduet
  //Blocker Adjustment
  val3 = analogRead(blockerPin);
  val3 = map(val1, 0, 1023, 0, 180); <-- igen, cut-n-paste fejl ;-)
  //Fire Action
  if (firePin == HIGH ){  <-- forkert. Det her vil ALTID være ikke-sand
  servo_spring.write(val1);  <--- dvs ALDRIG ekskvere dette.
  digital.write(releasePin, HIGH);
Men de fleste ting vil du opdage når du bare kobbler dine 3 servo op (uden katapulten) og det ligger på bordet og gør slet ikke det du forventede.

Men det er det rigtig sjove ved denne hobby !
64  Using Arduino / Programming Questions / Re: How to poll an analog pin until it is "High" on: May 13, 2014, 02:48:23 pm
 smiley-red oops.
65  Using Arduino / Programming Questions / Re: How to poll an analog pin until it is "High" on: May 13, 2014, 01:33:19 pm
Hint as to why
analogWrite (pin[k], analogRead (inputPin [k]) / 4);
is flawed:
==> Why you may need to use the map() function.

BTW - editing the top post makes it VERY hard for others to follow the thread as the earlier version of your question has disappeard, but the answers still stand in the thread.  I do not get the connection between making a LED intensity follow an analog input and the triangle wave fader.
66  Community / Exhibition / Gallery / Re: Blink without "delay()" - stepping up. on: May 12, 2014, 01:15:07 am
led1State = !led1State;//Invert Led1State, HIGH becomes LOW and LOW becomes HIGH.
Strictly speaking that is bad - HIGH / LOW are not the same as true / false. They may map to it, but it is a different "type".

I'd also add an explanation that, although this code only blinks LEDs, the principle can be use to time anything.
Oh yes, indeed. But, I have found through reading "a few" examples and newbie question that somehow for them going from a LED example to something else is too abstract/large a leap. Many want to see an example of one LED + one stepper or two DC motors or one button scan + two LEDs or any other specific combination.
67  Community / Bar Sport / Re: ship in a bottle 3D printer on: May 09, 2014, 03:10:04 pm
Good idea - but the laser beam will be distorted by the glass bottle. Still, it is a predictable distortion, also one that could be measured by first printing a grid (whioch you destroy and remove) and the software does the anti-distortion. I am skimming over focusiing problems.

Unless the beam comes in like the plastic prong drawn by Boffin1.

68  Community / Bar Sport / Re: Post your code on: May 09, 2014, 03:03:10 pm
Oh, how happy I am I managed to see this post. (I have times where life is to busy to read The Forum, and there is too much to catch up)

And by the 3rd line in the OP my mind was humming "Let it Be". Why, one wonders? There are not that many clues by then. Ah well, all the more the enjoyment og GMs vocal interpretation.

Defenitly nice - the lyrics. The song - well, we do not need to rate that. It is c l a s s i c 
69  Using Arduino / Project Guidance / Re: 2 Stepper Motors with 300 to 600 rpm on: May 07, 2014, 07:23:54 am
... And it will give me higher speed and smaller torque..
Will the motor turn if the supply to it is only 0.5A?
The lower amperage does not in any way imply that you get higher speed. I am saying that you can get enough speed even though you limit your current, and the formula-webpage implied that you could not reach full speed if you wanted full current.

The motor will turn with maybe only 100mA. I do not know, but for many steppers "just" turning you do not need a lot of mA. (I cant be bothered right now to read the fineprint in the spec sheet)

If you buy the chip, have you got knowledge/equipment to do the circuit board? I am worried as the discussion so far has shown that your electronics knowledge is not that great. (Nor is mine that great, really, but enough for the projects that I do) I would by something like - then it is much simpler. Also worry about the heat from the chip - it needs plenty air or a little heatsink.
70  Using Arduino / Project Guidance / Re: 2 Stepper Motors with 300 to 600 rpm on: May 07, 2014, 02:29:05 am
You only need all those Amperes if your motors need maximum torque, You have almost no load. (Well, I do not really know. Presumably there is some load as the vibrations you want to induce require energy, ie there is some transfer of mechanical energy from the turning eccentric).

Remember, you adjust the circuit of the DRV8825 to limit the current. (Are you buying the chip, or a board with supporting electronics?) For your experiment you want to supply as little current as possible - this will reduce the vibrations the motor itself generates.

I played a bit with the calculator link you supplied. Notice that as you decrease the current the calculated max speed increases. The calculation is just modelling a "simple" coil. It assumes you must get to Imax. If your speed is higher, then it simply does not get to Imax,, but the motor still turns at the higher speed. This is what the diagrams of the motor manufacture show - as speed increases the torque drops; the torque is proportional to the current and at high speed the current in the coil does not reach max value before it is turned off - that is what inductance does, so to speak. All sort of effects also play in, but the manufacture shows an actual measured curve.
71  Using Arduino / LEDs and Multiplexing / Re: 3 buttons for 3 LEDS - SOLVED on: May 04, 2014, 10:40:00 am
Well, if it works then everybody is happy. smiley

If it works and you do not know why it suddenly worked, then you may suddenly have a surprise. (It stops working)

Some possible faults have been mentioned. In addition I can suggest you may not have the wiring you think you have - which is why the troubles started with the 3rd LED/button. You may have an errenous wiring one that is wrong but happens to work for the wrong reasons.
72  Using Arduino / LEDs and Multiplexing / Re: Lcd shield for arduino? how to use it? on: May 03, 2014, 04:04:29 pm
Look at this --> section 7 about using code tags. Then stop begging for help. It is undignified.

Does the code work with your current setup? Does the Serial.print output give the correct (or close enough) result?

Removing the Servo code is trivial - unless I misunderstood the question - just delete those code lines that use it.
So all you want to do is to replace Serial.print with LCD.print ? ... have you looked at the example sketch File->Examples-LiquidCrystal->HelloWorld ?

We all were "newbies" at some point in time. (I noticed your earlier post) If this project is "too much", then try someting simpler first. As you learn by experimenting you will find how to do this.
73  Using Arduino / LEDs and Multiplexing / Re: 3 buttons for 3 LEDS on: May 03, 2014, 03:43:20 pm
There is nothing in you code that is "Limited by the UNO hardware".

From bitter experience I know that cut-n-pasted code-snippets and then changing variable names (your identical code sections that use ...RED, GRN and ...GRN1) is prone to forgetting or mixing up a name. I've looked and didnt find one, but these are hard to see.

PaulRB has asked about the pulldown resistor - this assumes the switch pulls the line high.

There is the possibililty that pin4 is "bad". If you played a lot with your UNO you may have "stressed" the pin. Try using pin 5 instead of 4.

74  Using Arduino / Programming Questions / Re: Can the Arduino do two things at one time? on: May 03, 2014, 03:00:34 pm
Going back to the question in the subject: "Can the Arduino do two things at one time?" the answer is NO.

BUT - by switching between two tasks often enough it will appear to do two (or three, four...) things at the same time.

This is why you see so many posts talk about the "Blink without delay" example, because neither of your two tasks may block - that is, sit in a loop doing something that takes time. They must do such tasks a small step at a time, remember how far they got, and when the loop() gets round to the again, take the next tiny step.

The trick of the "Blink without delay" technique is that the large "delay()" is actually just taken off in small bites by just executing millis() to look at the clock. See if helps explaining this.

Now, back to the program. I am sorry I have not studied your code. I have just looked if it had the classical error - using delay(). Yep.

"delay()" and "two things at once" are mutually exclusive.
75  Using Arduino / LEDs and Multiplexing / Re: Multiplication in Trinary on: May 03, 2014, 06:30:58 am
That sounds like an interesting project! What are you going to use it for? Pardon my suspicious nature, but it sounds so very much like an exercise given in school/college. I dont do other persons homework.

If it is because it is a nice challenge to programming, then I suggest you start by writing a sketch that can read a button and send a single character to Serial. What you'll find is the first minor hurdle, "switch debounce". When you fix that you can expand the program to count the button 1 pushes and and the answer on Serial when 2nd button is pushed.

If there is a particular issue that dumbfounds you, then post the code you've tried so far and explain what you want it to do, and what it actually does.

Lastly . Where does the "trinary" come in? A LED is a "binary" device (either On or off). Or are your "LEDs" actually digit display (7-seg) and you are displaying a number in trinary (i.e. using digits 0, 1 and 2 only)?
Edit: The OP edited his question explaining the trenary. So my question here is thus superflous.( I dont like edits to top ost that make my answer/help/clarifications seem idiotic.)
Pages: 1 ... 3 4 [5] 6 7 ... 88