Search results

  1. hippy

    Timer problem - advise?

    You could potentially count elapsed time in a loop, have some flowchart equivalent of ... Do : Loop Until inputPin = 1 w0 = 0 Do While inputPin = 1 Pause 10 w0 = w0 + 10 Loop
  2. hippy

    Can I control the brightness of 2 or more LED's with PWM?

    Thanks for clarifying. If HIGH and PWMOUT at 100% give the same brightness, but direct across the power rails gives a much greater brightness, that does suggest trying to draw too much current through the PICAXE I/O pins.
  3. hippy

    Can I control the brightness of 2 or more LED's with PWM?

    It sounds like the LED's may be trying to draw too much current from the output pins, are causing its voltage to collapse, which then means brightness is reduced. You will probably need to take the PWMOUT outputs to a FET or transistor which switches the LED power. But I am confused as to why...
  4. hippy

    Disability Aid

    This is how I would wire things - .--------------------------------------. | .----.----.---.----------.---|--------------.-- V+ | | | | | | | | | _|O _|O _|O | _|_ | | | |_| |_|...
  5. hippy

    Timer problem - advise?

    Without using multi-tasking you can solve the problem by having a fixed loop time. Count the time elapsed and then, alter the the time required for each timer has elapsed toggle an output for example, something like - Do Pause 10 timer1elapsed = timer1elapsed + 10 timer2elapsed =...
  6. hippy

    Disability Aid

    That makes sense. So it really is a case of push any button, light the corresponding LED. The following code will work in simulation and should on an actual chip. It turns the LED on which corresponds to the button pushed, turns them all off after two seconds of no push, for when the teacher...
  7. hippy

    Faster code for MS5611 variometer

    Presumably just for curiosity, because 'works almost as well' with no practical gain isn't really an improvement. I must admit I would have probably gone the other way, increasing the number of samples for averaging, but as long as it works.
  8. hippy

    Disability Aid

    That's still not a complete specification though. As it reads; any sequence of all three button pushes without repeating a button push would reach the end of the task. There's no indication of programming the sequence, or how one distinguishes between programming and the student following the...
  9. hippy

    Can I control the brightness of 2 or more LED's with PWM?

    If using the code in Post #9, you should be able to test full brightness by inserting the following before the "MainLoop:' label - InitLed( LED1, w1, bit1, LED1_MAX ) InitLed( LED2, w2, bit2, LED2_MAX ) InitLed( LED3, w3, bit3, LED3_MAX ) InitLed( LED4, w4, bit4, LED4_MAX ) Do : Loop It might...
  10. hippy

    Disability Aid

    I suspect, if you tried to simulated the code exactly as was quoted, the issue is that it doesn't include any PICAXE, button or LED definitions. It is going to produce some kind of 'don't know what that is' error as soon as a syntax check or simulation is attempted. It always helps to say what...
  11. hippy

    Can I control the brightness of 2 or more LED's with PWM?

    Perhaps post the code you have which may reveal why you are not getting full brightness. It should be possible to have (almost) full brightness when the duty is four times the period value, full brightness is when duty is four times the period plus three. If using a variable duty value then it...
  12. hippy

    14M2 2-4 line LCD PCB

    It might be worth removing the PICAXE. When powered up without any PICAXE it should show a single line of solid blocks. If they are very faint you could try isolating the contrast pin, jumpering any required 0V around it, then connecting a 1.5V battery with +Ve to 0V, -Ve to the LCD pin...
  13. hippy

    Disability Aid

    My take on it, but only playing one game, no reprogramming after victory, have to restart the simulation ... #Picaxe 08M2 Symbol LED1 = C.2 Symbol LED2 = C.1 Symbol LED3 = C.0 Symbol BUTTON1 = pinC.3 Symbol BUTTON2 = pinC.4 Symbol BUTTON3 = pinC.5 Symbol PUSHED...
  14. hippy

    Disability Aid

    Yes; something like that should work. Your code could be optimised and shortened by having a "GetSomeButton" and a "SaveThatButton" routine with some incrementing index of where to write the data to, which would also allow it to be extended to more that three button pushes. The 'can they follow...
  15. hippy

    Disability Aid

    That is rather more complicated than a fixed sequence program. You would need to determine which of the buttons are pressed in turn, remember those, then match what the child is pressing with what the stored sequence is. It is possible, but would take more than a couple of minutes to do.
  16. hippy

    14M2 2-4 line LCD PCB

    As said, that is the pin which a contrast pot connects to. Contrast is higher when towards 0V, and connecting directly to 0V usually works, if anything perhaps giving a slightly too high contract. There are however some LCD displays which require a negative voltage on the pin to create a proper...
  17. hippy

    Disability Aid

    Here's the other way I would do it. Technically a little more advanced but just as simple. One can replace #DEFINE with #MACRO if more than one line of code needs to be used to achieve a particular intent - #Picaxe 08M2 Symbol LED1 = C.2 Symbol LED2 = C.1 Symbol LED3 = C.0 Symbol...
  18. hippy

    Disability Aid

    My approach to programming is to write each step of the program out as a sequence of commands prefaced with a GOSUB. So what you seem to want is - Do Gosub TurnLed1Off Gosub TurnLed2Off Gosub TurnLed3Off Gosub WaitForButton1Pushed Gosub TurnLed1On Gosub WaitForButton2Pushed Gosub...
  19. hippy

    VARIOMETER using GY63/MS5611 barometer

    The $ sign indicates the number which follows is hexadecimal, % indicates it is binary. The # is used within commands to indicate that a number should be output ( or received ) as a string of characters which represent a decimal value.
  20. hippy

    VARIOMETER using GY63/MS5611 barometer

    GenerateTone: diff = -diff If diff >= 8000 Then That last line should be "If diff >= $8000 Then" but, other than that, it is good to know it's working. With the tone generation moved to its own routine it will be easier to adjust the tone so it reflects how much it's rising or falling.
Top