Show Posts
Pages: 1 ... 43 44 [45] 46 47 ... 88
661  International / Scandinavia / Re: Arduino Uno + Easydriver + Stepper motor = Timelapse slide on: October 23, 2012, 03:08:08 pm
hej.

Uden at du vedlægger lidt kode ved jeg jo ikke hvad du har prøvet. Husk at bruge den der "#"-knap ovenfor så din kode kommer i smuk kasse med scrollbars (og ikke laver smileys hvor det bare er luk-parantes)

Quote
virker ikke medmindre USB er sat i (på trods af DC strømforsyning),
er en klassiker - du har ikke nok strøm i din strømforsyning. (Strømforsyningen der går ind i DC stikket på Arduinoen bør være 7V eller lidt mere og give mindst 500mA for at være på ligefod med USB) Den anden er at - afhængigt af din motor som jeg ikke ved noget om - du ikke bør suge strøm fra Arduino board/chippen for at drive en motor.

Jeg skal have et billede (eller en håndtegning du har scannet eller fotograferet) af dit kredsløb. Og et type nummer, helst en link til datablad af din motor.

Ja, du vil nu ikke "bare" skifte dæk, du vil faktisk skifte bremser - for at holde analogien. Kan også gøre uden den store mekanikker udannelse, men kræver lidt indsigt i nogle principper. Og det duer ikke at sige "røret virker for småt" uden at fortælle hvilken bil og bremsetype det drejer sig om. Nok om analogien - lad os se på kode og kredsløb, så er det nok en smal sag.
662  International / Scandinavia / Re: Arduino til en tørretumbler on: October 21, 2012, 01:58:17 pm
Code:
if (EEPROM.read(CONFIG_START + 0) == CONFIG_VERSION[0] &&
      EEPROM.read(CONFIG_START + 1) == CONFIG_VERSION[1] &&
      EEPROM.read(CONFIG_START + 2) == CONFIG_VERSION[2])
Det sammenligner 3 bytes om de alle er ens. Om det er en 3 bogstavs streng eller 3 små tal, eller et 24bits tal er koden uvidende om. det er en fortolkning af de 3 bytes som "brugeren" gør.
663  International / Scandinavia / Re: Arduino til en tørretumbler on: October 19, 2012, 07:56:44 am
... ahh, lige hvad jeg mistænkte. EEPROM.write klarer en BYTE, ikke en streng. Så du skal bruge noget i stil med
Code:
for ( int i=0; c1t[i] ; i++) EEPROM.write ;
Det vil gemme alle tegn i sin din streng, indtil den møder nul byten. (Den kommer desværre ikke med...) Næste forsøg:
Code:
int i=0; while (c1t[i++]) EEPROM.write(c1t[i]) ;
Ja, der skal files lidt, men sådan cirka.
664  International / Scandinavia / Re: Arduino til en tørretumbler on: October 19, 2012, 07:51:48 am
Jeg har ikke brugt EEPROM endnu. Så nu slår jeg lidt op i manualen ...
665  Community / Website and Forum / Re: Karma is back on: October 18, 2012, 03:13:07 pm
Grumpy Mike deserves all the Karma he can get. There - I just gave him another.
666  International / Scandinavia / Re: Arduino til en tørretumbler on: October 18, 2012, 08:49:58 am
Nåh Boelle du ser ud til at holde dig selv underholdt med dialog smiley

Jeg ser du også har samme spørgsmål kørende glimrende på engelsk her - må jeg foreslå at du holder tråden eet sted? (At det er på to forskellige sprog fritager den for "no crossposting" reglen, men ... )

OT: Jeg synes også det er synd der ikke er mere "go" i den skandiviske del (og at der er en Skandinavisk forum skyldes at den ene af de oprindelige Arduino folkene bor i Malmö) men dette TopicArea er best til dem der har sprog problemer eller for ting der naturligt er geografisk begrænset (f.eks. lokale indkøbssteder)
667  International / Scandinavia / Re: Magnet føler on: October 09, 2012, 05:02:42 pm
Hej,

i løse træk så kigger du med digitalRead på din input ved hver gang du kører igennem loop(), hvis den skifter til lav, så noterer du dig indholdet af millis(). Hvis den er høj og difernecen millis()-noteretværdi er mindre end 5 ignorer du det (kontakt prellning). Ellers så er den virkeligt ved at gå høj og så er differencen millis()-noteretværdi den tid det tog.
668  Using Arduino / Programming Questions / Re: How to clean up Serial port buffer on: October 08, 2012, 12:33:57 pm
serialEvent() is not an interrupt handler. Look inside hardware/arduino/cores/arduino/HardwareSerial.cpp
When I get the time. smiley If it just gets called before entering the loop() again... damn, I'll just have to look now
click, click, editor-woosh
Code:
for (;;) {
  loop();
  if (serialEventRun) serialEventRun();
  }
OK, so you could get called in the Serial.serialEvent routine with loads of characters, if your loop is full of delays - like the OP's 3 second.
669  Using Arduino / Programming Questions / Re: How to clean up Serial port buffer on: October 07, 2012, 04:49:06 pm
I am sorry, I do not get the purpose of your code - even allowing for it to be a demo/test of a percieved error.

There are two ways of reading Serial data.

The first is to occasionally call Serial.available(), and call Serial.read() to handle the character if it has arrived. If the Serial managed to receive 3 characters between your calling Serial.available() then the 2nd and 3rd byte will still be there on your next check & read call. If you expected 5 bytes, and only 3 arrived .. do something else until calling available again to see if they have arrived.

The other way, is the Serial.event(), which looks to me like an interrupt routine. (Admittedly never used it - never had a need) As it gets called (interrupting what your program was doing) immediatly after a byte is received, there will only be ONE byte to read. Doing Serial.readBytesUntil is going to confuse/break everything.

Unless you are truly confident/knowledgeble with handling interrupts, then stick with the above polling technique.

I have never heard of the AVR serial "getting dirty". And no, you have not discovered a new an exquiste subtle bug.
670  Using Arduino / Programming Questions / Re: Problem calling a function from another function on: September 26, 2012, 03:31:24 pm
There are a number of typos in the code snippets in your last reply. It's OK, I hit he wrong key too sometimes. But in this case, as we're trying to help you with a coding issue, you must cut-N-paste the actual code you use, not retype it in the forum. Otherwise we would suggest fixes to something not present in your code, and we can't comment on that which you have not typed in.

So start a new tiny sketch, where you only use, say, pin 5 and your registerWrite routine. with/without a for loop or an oneline extra function.
671  Using Arduino / Programming Questions / Re: Problem calling a function from another function on: September 26, 2012, 01:37:27 pm
The way I read your code:
Code:
void registerWrite(int whichPin, int whichState) {
  byte bitsToSend = 0;
  bitWrite(bitsToSend, whichPin, whichState); 
  shiftOut(dataPin, clockPin, MSBFIRST, bitsToSend);
The routine ALWAYS starts with bitsToSend at zero. If you called it with
Code:
  registerWrite(5, HIGH);
it will correctly set and transfer bit 5 to the shift register.
A second later your code in runAnimation reaches
Code:
  registerWrite(6, HIGH);
Because the bitsToSend starts with zero, bit 5 is now clear(low) again, as we set bit 6.

This is "simply" fixed by putting the word static in front. bitsToSend will now keep the value of 5 to what you set it to, until you explicitly reset it.
Code:
static byte bitsToSend = 0;

This does not explain why the test loop "seems" to work, but I suspect you expected each port to turn on in sequence and missed that the only one port on at a time was turned on when your expectation (from the way I read your code) shoudl have been that more and more turned on.
672  Using Arduino / LEDs and Multiplexing / Re: [Advice needed] Building a small BCD clock. on: September 26, 2012, 09:48:39 am
atmega328, 16 mhz crystal, two 22pf caps, three 100nF caps.
14 resistors, 14 LEDs.
A board to mount the stuff on.  And access to someone else's system with a serial line to program it. Easier if the atmega328 already has a bootloader programmed.
673  Using Arduino / Motors, Mechanics, and Power / Re: Choosing power supply for steppers on: September 26, 2012, 09:29:57 am
The datasheet shows the "Ohm law" relation - ie what voltage will reach maximum current. What one would like to know is the voltage the insulation of the windings can tolerate. A "modern" stepper driver chip does PWM to keep the current at the desired maximum level but pulses it with the supplied voltage which is several times higher. In theory the higher voltage will allow you to go for (slightly) higher max step speed and give a little more torque.

I suppose you can just turn the voltage up until it starts smoking, then use less than that on your next motor :-)

Alternativly use a conservative voltage (say 9V in your case) and if that is enough speed/torque for what you final machine is to do, fine. Otherwise beef it up until the motor or your courage gives up. You driver chip will propably limit you to 30V.
674  Community / Website and Forum / Re: Karma is back on: September 26, 2012, 09:08:42 am
<resigned sigh ....>
675  Community / Bar Sport / Re: Interstellar Travel on: September 26, 2012, 08:55:27 am
The Burj Khalif in Dubai is 800m tall. Another 200m and we're there. The video gave me no clue what so ever why the air should be 70 at the foot of the tower.
Pages: 1 ... 43 44 [45] 46 47 ... 88