Recent content by Aries

  1. Aries

    Saving data into 08M2 internal memory

    I think /4 would be better, as you want to strip them off, rather than use only the two low bytes which is what you get with //4 (it only has values 0,1,2,3)
  2. Aries

    How to reset the timer (20X2)

    At the risk of stating the obvious - try it. Write a very simple program, say for b0 = 1 to 20 sertxd(13,10,#timer) pause 1000 next b0 timer = 0 for b0 = 1 to 20 sertxd(13,10,#timer) pause 1000 next b0 which will show you whether timer is reset. Equally, instead of timer = 0, try a...
  3. Aries

    Byte variable math, can calculations be greater than 255?

    Given that B0 is always a variable, there is no way that the compiler could do the calculation rather than the Picaxe itself. Even if the compiler spotted the 150/2, it could do nothing useful with it, because it still has to divide B0 by 2. In general, I think it's fair to say that the...
  4. Aries

    Reading Complete Port question

    Alternatively, with the WaitForSwitch in its own subroutine, insert a gosub WaitForSwitch immediately before the return in your subroutines SW1-SW10. This avoids the spaghetti-like mix of GOTOs and subroutines but (as an old assembly-language programmer) I would probably do what Buzby suggests...
  5. Aries

    Absolute encoder programming

    You have set the terminal speed to 115200. However, for sertxd, the terminal speed is effectively determined by the frequency of the Picaxe. For a 28X2, the default speed is 8MHz, with a terminal speed of 9600. At 16MHz, the speed would be 19200 - twice as fast. If you have an external...
  6. Aries

    i2c address format

    Binary, hexadecimal and decimal are all simply different ways of writing the same thing. 0x23 is a hexadecimal number, meaning 2*16 + 3 (=35 in decimal) In binary it is 00100011 (0*128 + 0*64 + 1*32 + 0*16 + 0*8 + 0*4 + 1*2 + 1*1) (EDIT) Oh, and by the way, if your address is 0x23, you will...
  7. Aries

    eeprom endurance

    Reads do not affect the life of a memory location, it is only writes. If the value you are going to write to an EEPROM location is the same as the one already there, you will still use up a life. The simplest way to avoid wasting lives is to check before writing ... ' assume writing b0 to...
  8. Aries

    axe133y oled display kit

    The Picaxe manual 1 (https://picaxe.com/docs/picaxe_manual1.pdf) has diagrams and descriptions of all the pins of all the picaxes. Any Picaxe pin described as OUT (e.g. C.1, C.2 on 08M2, any PORT.PIN on a 28X2, although I wouldn't use A.4 which is for sertxd and programming) can be used for...
  9. Aries

    Code structure - loop or goto

    I think that EXIT exits only from do...loop or for...next which are essentially equivalent constructions, and so it does the same thing in each case - i.e. exits the loop. Trying to use EXIT within an if block gives a compiler error (unless it happens to be within a loop, of course)
  10. Aries

    Underflow issue... Again :-(

    w0 = w0 min w1 - w1 will ensure that your result is never "negative". The min gives a value which is the maximum of w0 and w1. This is never less than w1, and so the result is never less than zero.
  11. Aries

    Restarting a Program

    The RUN command works on X2s and on any hardware which supports multiple slots - i.e. M2 under PE6.
  12. Aries

    SEROUT Hex Numbers?

    Just looking at the manual (the "introduction" on banggood), you have commands like: serial.write(0x37) That isn't sending hex characters - it is sending the value (in Picaxe terms) $37 (or 55 decimal)
  13. Aries

    X2 program slots

    I have (at least) three multi-slot programs on 28X2s. One is for monitoring electricity consumption and photovoltaic generation, one is for the underfloor heating controller, and the other is (in progress) for the gas-fired heating system. They are designed in a similar way (much like...
  14. Aries

    Scanning TOF10120 with output to OLED

    Thanks for the code - it will (hopefully) be useful in a project I have planned. I don't know if you need speed, and these are minor points, but ... hi2cin [TOF10120],(RangeHighByte,RangeLowByte) ;reads range up to 255mm as RangeLowByte, then increments...
  15. Aries

    CALIBADC & CALIBADC10

    Alan, Thanks for your thoughts, and the time you have spent on it. This is now getting rather beyond me and, as I said, it's not important to what I really need to do, so I'm going to have to set it to one side - for now, at least.
Top