Search results

  1. lbenson

    Replicating commands from ar***no

    From 10 years ago: xbox Rapid Fire And others if you search: "rapid fire" site:picaxeforum.co.uk
  2. lbenson

    ssd1306_picaxe40x2 solar heater

    It's not normal. Can you post a good photo of the "strange characters"? What has the truck been doing when it gets the strange characters and freezes?
  3. lbenson

    Motor Pulses with Pwmout

    As hippy said--but in addition, this would have been a good line of code to try in the simulator. You could have seen what the problem was. Tex--glad I added "or fallen off" after originally having typed only "dead man's switch". I just think "dead man's switch" is such a cool idea. I wonder if...
  4. lbenson

    PWM function to control 12v LEDs

    The 22K resistor in the download circuit is designed to protect against possible RS232 levels, so good to +15V or so. The 10K to 0V would assure that it doesn't float when disconnected. Make sure the 2 Rs aren't wired as a voltage divider. Re "not bright enough", the 12V pwm would allow greater...
  5. lbenson

    PWM function to control 12v LEDs

    Unless the variable dimming is required, could you not just run from the unswitched 12V through a resistor (chosen by experiment but starting with 800 ohms to halve the current) in place of the line from the picaxe? When the switch is depressed and both feeds are active, you're still limited by...
  6. lbenson

    Compensating TOUCH16 values due to supply voltage variance.

    There are others with more expertise and experience who can perhaps explain it better, and give examples, but my understanding is the the fixed FVR value allows you to determine what percentage of your norm (say 3V for a CR2032) your actual voltage is, so you can then apply that percentage to...
  7. lbenson

    Motor Pulses with Pwmout

    I was actually thinking of a second "slow down" button, such as hippy has. And mortifyu's "dead man's switch" or "fallen off switch" also seems good. Using MIN with subtraction can be tricky. In your code, "b0=b0-1 MIN 0", what happens when b0 is 0 and then has 1 subtracted from it (considering...
  8. lbenson

    Motor Pulses with Pwmout

    What variety of "didn't work"? Duty cycle runs 0-1023, so needs a word variable (although that in itself would not make it fail to work--just not work as expected, e.g., if you said b0=512, expecting half speed, you would actually end up with b0 equal to 0). If you reach "fast", how do you ever...
  9. lbenson

    PWM function to control 12v LEDs

    Right, I was confusing maximum current for 8 LEDs at 12V with maximum current at 5V. Thanks, hippy and hemi. I think I understand better now.
  10. lbenson

    PWM function to control 12v LEDs

    I've looked at the diagrams, and I don't really understand what the switch activates and how that controls the bright/dim states. What is the C connection--is it 12V? What is its purpose in the circuit? Related: what is the distinction between the two red lines on the right by +12V? So when...
  11. lbenson

    PWM function to control 12v LEDs

    Here is a p-channel mosfet circuit. Your lamps would be connected to "OUTPUT". R1 could be 10K or more. That's GATE negative relative to SOURCE--the circuit above achieves that when CONTROL is HIGH, making the 2n7000 n-ch "signal" mosfet conduct, which brings the gate of the IRF9530 (or almost...
  12. lbenson

    "Calibrating" LDR using a separate "ambient" LDR

    Only because of and I didn't have a 20X2 handy. As a bonus, that made me realize that for the M2s, the B.1, etc. pin numbers were the same as the ADC pin numbers. I didn't realize that you could redefine ptr as bptr. Neat trick. Doesn't ADR_BASE for the M2 need to be higher, like $30?
  13. lbenson

    "Calibrating" LDR using a separate "ambient" LDR

    Ok, here's a version of hippy's code which should run on either a 20X2 or 20M2. In addition to the change in the table definitions for the ADC pin numbers, I made it use bptr and upper ram on the 20M2 instead of ptr and scratchpad (it could be fitted with juggling, but the 20X2 has limited ram)...
  14. lbenson

    PWM function to control 12v LEDs

    The 14M2 has 4 separate PWM pins, so if you want to control 8 lights at separate pwm levels, you would need two. If you want them all to be at the same level simultaneously, but vary that level for all, you don't need the ULN2803--you could use a single logic-level mosfet like the IRL520 (which...
  15. lbenson

    "Calibrating" LDR using a separate "ambient" LDR

    Thanks for that.
  16. lbenson

    "Calibrating" LDR using a separate "ambient" LDR

    This is what I got running on a 20M2 while rubbing my fingers along the otherwise unconnected pins--so variation was detected. 0-59 1-36 2-0 3-31 4-0 5-8 6-0 15-0 11-0 10-28 9-4 0-0 1-17 2-12 3-0 4-16 5-0 6-18 15-0 11-25 10-4 9-0 0-0 1-2 2-19 3-15 4-0 5-5 6-9 15-0 11-0 10-18 9-1 0-0 1-32 2-6...
  17. lbenson

    "Calibrating" LDR using a separate "ambient" LDR

    As it turns out, the "old" code +will+ work on a 20M2 (as far as the READADCs go) because on the M2 parts, the pin number is the same as the ADC pin number. But everything using PTR won't work, because scratchpad is not available on the M2s--however the code could be rewritten to use bptr and...
  18. lbenson

    "Calibrating" LDR using a separate "ambient" LDR

    I believe (as modified with the new table values), it would run as expected--but I also don't have a convenient way to get 11 distinct ADC values (though I wonder what you would get if the pins are just floating).
  19. lbenson

    "Calibrating" LDR using a separate "ambient" LDR

    I find that when stepping through in simulation with a 20X2, on the first READADC it totally locks up PE6, requiring it to be terminated with Task Manager. Presumably, this is because the first adc command, which is effectively READADC 0,adc, is trying to read a non-existent ADC pin, ADC0. If I...
  20. lbenson

    "Calibrating" LDR using a separate "ambient" LDR

    Good catch. As someone (probably hippy) pointed out to me years ago, you can use, for instance, READADC B.1,result in your program because the preprocessor recognizes your intention and puts the right code in. However, if you use B5=B.1: READADC B5,result, the preprocessor can't read your mind...
Top