Recent Posts

Pages: [1] 2 3 ... 10
1
As I said in Reply #4, I was looking for a way to define a PROGMEM string once and then be able to print it from multiple locations in the code. So, since it's defined in only one place, I could change it (at compile time) to a different string and the change would be effective everywhere it's used. This works (even in Global space):
Code: [Select]
const char string[] PROGMEM  =  "Hello World";
  __FlashStringHelper *hello = (__FlashStringHelper *)string;
2
Programming Questions / Re: LCD Encoder Menu
Last post by dougp - Today at 01:36 am
If you were to substiture enCount for IRQcounter in my snippet - not the ISR - and define arbitrary values for DIR_CW & DIR_CCW (+1, -1?) it would function correctly.  Essentially, a +1 value value given to encoderCount substitutes for the original pushbutton up keypress.  Likewise -1 for down.
3
Homework - at my age  :P
It sure beats tapping a stick around in the dark...
4
Project Guidance / Sending a starter kit to Franc...
Last post by Shafroth - Today at 01:35 am
I want to buy a kit for my son who is living in France.  Does Arduino ship to France?
5
Software / Re: usar millis() junto con fo...
Last post by IgnoranteAbsoluto - Today at 01:34 am
si, me equivoque, ese era el del error, el otro fue el primero
Aún así, en tu código continúas mezclando for con millis(). Si usas millis() porque no quieres que se bloquee el loop(), no uses un for para algo que no quieres que se haga lo más rápido posible.

No has dicho qué quieres hacer exactamente. Suponiendo que quieras hacer lo que te pregunté, aquí tienes el programa:

Code: [Select]
#include <Servo.h>

const unsigned long TIEMPO_INCREMENTO = 10;
const int ANGULO_MINIMO = 0;
const int ANGULO_MAXIMO = 180;
const int PIN_SERVO = 9;

unsigned long instanteAnterior = 0;
int angulo = ANGULO_MINIMO;
int incremento = -1;

Servo miServo;

void setup() {
    miServo.attach(PIN_SERVO);
}

void loop() {
    unsigned long instanteActual = millis();
    if( (instanteActual - instanteAnterior) >= TIEMPO_INCREMENTO ) {
        instanteAnterior = instanteActual;
        if ( (angulo <= ANGULO_MINIMO) || (angulo >= ANGULO_MAXIMO) ) {
            incremento = -incremento;
        }
        angulo += incremento;
        miServo.write(angulo);             
    }
}


Como puedes ver, no hay ningún for y ni se le espera.
6
Hello!
   
   As silly as this may be... I just recently started playing with Arduino and am currently trying to set the sketch up to turn the PID function off until the User sends a new Setpoint higher than 300 and less than 800.
the goal is to try to use Fahrenheit even though I'm fairly familiar with Celsius.
i would also be ok with the Setpoint being 0 when the PID is "OFF" as it will very rarely actually be powered down.

the Code below is what  currently have. Once I can change the Setpoint I can manage the rest I believe.

7
Project Guidance / Re: Feasibility: Moving target...
Last post by MJH - Today at 01:28 am
Thanks for the quick reply!

Ok, so is this more suitable?
http://www.dx.com/no/p/28ybt-48-stepper-motor-with-uln2003-driver-dc-5v-126409#.Wi3QL4yUmEc

Is it better to use an uno than say a Micro Pro? Seems i can then maki it much more compact. Planning on wiring directly.
8




Risky post of the day. Now many people will say I didn't do a good job? I know the connections are secure. I have done quite a bit of soldering. I also know there are no shorts on the board and I know where each pin goes.
9
Ok, so Strings are piling up on sram ....
Still I have  over 5 kB free from start...
Is it like every time I set a value to a String it will take more space in sram ?
Like if I set  4 bytes first time and 8 bytes next time I will end up using 12 bytes or 8 bytes in sram ?
Everybody tell me NOT to use Strings so maybe it's time to work on that.
I just have a hard time to figure it out with buffers and pointers.
Like can I pass a text buffer by buffer name just like I pass a String ?
Thanks for effort guys :)
10
Sensors / Re: Reading Encoder- Trending ...
Last post by Paul_KD7HB - Today at 01:22 am
I am sure you know "trend" can be between -1 and +1, so A strange trend is not possible. Are you looking at the superimposed reduced peaked values of your graph? With no time values on your graph, it's a bit hard to know if it is noise being picked up on your encoder reading or what. A schematic of what you have, including any bypass capacitors would help a lot. What do you have powering the project? What actual frequency is your project operating at?

How much time  used in reversing direction?

Paul
Pages: [1] 2 3 ... 10