Search results

  1. M

    Optocoupler for PC PSU's 5V line to Picaxe input pin?

    I'm hopefully going to put together a picaxe based 'alarm', which will sound when/if I leave the power switched on at the wall when I've turned the PC off. Leaving it like this wastes electricity, as the monitor etc are still on standby, and I keep forgetting... Powered from a 5V phone charger...
  2. M

    Help needed choosing relays

    Hi, I have a treadmill motor (rated 1.5Hp, 4800 rpm, 230V DC) and controller which I can run from a picaxe pwm. The controller only runs in one direction, but I want to use it in reverse too. In my intended application, it will always stop for at least a fraction of a second before reversing...
  3. M

    Control treadmill motor from picaxe

    Hi, I have a tentative plan to build a 'single axis cnc' type of machine, using a salvaged treadmill motor (probably) to drive an M24 threaded rod to move a heavy object up to +-450mm, with a simple (hopefully) hall effect revcounter to give 'distance travelled' feedback to the picaxe; the...
  4. M

    'on goto'; return problem

    I wrote this instead of a 'case select' block, to speed up execution. For b5 = 1 to 8 on b5 goto cL0, cL1, cL2, cL3, cL4, cL5, cL6, cL7, cL8 'cL0 is dummy next b5 b5 = 0 'reset b5 for use in main cL0: cL1: w1 = $0100 : gosub sendToLedsW1 cL2: w1 = $0200 : gosub sendToLedsW1 cL3: w1 =...
  5. M

    macro call syntax- confused

    This is probably going to be another obvious one, but having looked at the manual and examples, this is not yet obvious to me: #macro clearRow(b5): 'code involving b5 in some way #endmacro in main: For b5 = 1 to 8 clearRow(b5) 'etc What do I have to write instead of 'clearRow(b5)' to get...
  6. M

    eeprom readnot reliable with binary values?

    Running this as a simulation, not tried on the picaxe itself yet (lcd no longer working; apparently hooking it up to 12V supply kills the right hand side of the screen, so I can only see 8 digit numbers on each line now...) The code below should read 2 consecutive eeprom addresses into a word...
  7. M

    combining 2 8 bits data from eeprom into 16 bit data

    I have 16 bit addresses stored in 2 sequential eeprom addresses, and I want to combine them into a 16 bit word, to address a max7219 chip. I thought there was a method that used 'highbyte' and 'lowbyte', but I can't find anything about it. instead of combining the 2 bytes into a word, can I...
  8. M

    bitwise logic/arithmetic problem

    This isnt strictly a picaxe problem, but more of a logic one I think:- I'm trying to find a relationship between the following 2 columns of data: 10000000 8 1000000 7 100000 6 10000 5 1000 4 100 3 10 2 1 1...
  9. M

    Advice needed for taking input from 53 LDRs..

    I may need to make a linear array of 53 4mm LDRs, for reasons I'll go into if anyone is really really curious. Only 1 of them will see light at any time, and their outputs will be treated strictly as on or off. Is there some way of multiplexing this number of inputs, and outputting the address...
  10. M

    violin synth works, sort of... note response too slow, different approach needed?

    Finally got this code to work... and it's very laggy indeed when notes are called that require the processor to run slowly and/ or pwm DIV to equal a low value:- 'violin synth with 4 strings, too slow 'G string C.4 pin6 'D string B.3 pin15 'A string C.0 pin10 'E string B.2 pin16 'pwm1 = C.2...
  11. M

    Possible program flow glitch, program crashes randomly

    The attached program is a 'violin synthesiser', that uses 1 adc and 4 output pins (one for each 'string'.) The program cycles through each output to test for adc values that are only > 0 when a 'string' contacts a fret (ie a point along the resistor network in attached pic.) That adc value...
  12. M

    reading sequential eeprom addresses, syntax problem using the data

    I'm away from my pc with all the picaxe stuff on it, trying to write the (hopefully) last piece of code while I have some time, but not able to compile/run/test it for a week or so, so this is probably going to be rubbish code anyway... This should hopefully compute the value of b1, which gets...
  13. M

    If var1 = (range of values) OR var 2 = ... Syntax?

    Trying to write:- If b0 = 1 TO 5 OR b1 = 6 TO 10 OR b2 = 131 TO 136 OR b3 = 212 TO 218 then b4 = "Y": b5 = "2": End If But the editor gets hung up at the '5'. I'm not sure if I'm also supposed to nest 'OR's in parentheses? What is the syntax for testing multiple variables for ranges of values...
  14. M

    Need maths help designing lgarithmic input for adc

    I think I can eventually bodge my way to a solution to this, but if possible I'd like to do a proper job of optimising this on paper first. Only trouble is, my maths isn't up to it... Have a look at the attached jpeg. The circuit is very simple; a version of it with all 10K pots has been...
  15. M

    axe 133 problem with display; is it dead?

    Today my axe 133 budget 16 x 2 lcd screen decided to show me 32 blocks of solid grey instead of the usual start screen. When I power it down, the 'www.picaxe.com' etc becomes visible briefly. Have I killed it?
  16. M

    Odd lcd values on 2nd line of axe133

    This code main: b0 = 100 b1 = 200 b2 = 300 b3 = 400 serout C.5,N2400,(254,128) serout C.5,N2400,("b0= ", #b0, " ") serout C.5,N2400,(254,192) serout C.5,N2400,("b2= ", #b2, " ") serout C.5,N2400,(254,137) serout C.5,N2400,("b1= ", #b1) serout C.5,N2400,(254,201) serout C.5,N2400,("b3= "...
  17. M

    EEPROM:- possible to read/write bit by bit rather than byte by byte?

    It struck me today that, if it were possible, it might be handy to store and retrieve information from a picaxe eeprom bit by bit, rather than byte by byte, if memory space was an issue. Is this possible to do directly? Or would it involve concatenating the 'bits' into bytes, in order to write...
  18. M

    Editor only shows 'COM1', axe027 listed under usb controllers, has no port number.

    Hi, Reloaded Win7 and picaxe editor, etc onto new HD in same PC I've done all previous picaxe work on. Followed instalation instructions, axe027_installer failed for unknown reason, so manually added drivers on all my usb ports (port numbers 3-6.) Axe027 currently plugged into USB port with...
  19. M

    bizarre picaxe arithmetic; 630 = 118

    This program:- init: pause 500 main: serout B.1,N2400,(254,1) pause 30 low B.0 low B.2 pause 200 serout B.1,N2400,(254,192) serout B.1,N2400,("init") pause 300 readadc B.4,b1 pause 30 serout B.1,N2400,(254,128) serout B.1,N2400, ("init is") serout B.1,N2400, (#b1) pause 2500 high...
  20. M

    misunderstanding calculation involving modulo

    I've recently resurected a piece of hardware that uses a picaxe 08m2 to read a light sensor before and after an external operation, place those 2 values into variables b1 and b2, and compare. I'ts supposed to check that a) the second reading (b2) is lower than the first, and that the first...
Top