# (ascii) and Middle Zeroes

QuadeHale

New Member
I've been outputting to an LCD a word variable - usually around 400. It works simply enough with something like #w0 in an hserout line, however, if the number itself is in the range of 400-409, that middle zero is dropped (ie. 401 shows as 41, 402 shows as 42 and so on). Same with 300-309, 200-209, and so on and so forth. Is this a bug, or intended? I know the # operator is only shown in the manual working with byte-level variables. Anyone have a simple fix/solution? It's been racking my brain all morning >.<
 

hippy

Ex-Staff (retired)
I recall mention of this before, and it should work as expected. Ledaing zeroes are always dropped using # but those in the middle shouldn't be.

One workround is to use the BIN2ASCII command to split a number into individual digits and send them separately. Untested, but something like this -

Code:
  Bin2Ascii w0, b3,b4,b5,b6,b7
  If w0 >= 10000 Then : HserOut 0,(b3) : End If
  If w0 >= 1000  Then : HserOut 0,(b4) : End If
  If w0 >= 100   Then : HserOut 0,(b5) : End If
  If w0 >= 10    Then : HserOut 0,(b6) : End If
  HserOut 0,(b7)
 

QuadeHale

New Member
Figures that I found that command about 5 minutes before you posted :D To Technical: is this bug to be fixed with the next release of the editor?
 

GreenLeader

Senior Member
I've just come across this problem too - hserout dropping the middle 0 from numbers, so 107 becomes 17... Painful.

I see that it is a known bug - is there any news on when it will be fixed?

I have a 40X1 - will it be possible to have it updated with the fix or have I got to buy a new PICAXE to get the latest firmware?
 

hippy

Ex-Staff (retired)
You cannot upgrade PICAXE Firmware yourself. Best to email your dealer / Rev-Ed on getting a chip upgraded but it may be less hassle all round to put it to one side to use in a project where it's not a problem and buy another.

I have no idea if the bug fix has been released or in what firmware version it was fixed.
 

tarzan

Senior Member
Firmware &amp; Revision

This is one area I would like to see a big improvement on. Reporting firmware fixes, known bugs and which firmware is currently on the market.

This from the latest "firmware.txt" & "revision.txt"; no word on this bug.

*** PICAXE-28X1 (40X1) ***
The PICAXE-28X1 (40X1) firmware is implemented on a PIC16F886 (PIC16F887)
BASE FIRMWARE CODE:A
V0 FIRST PUBLIC RELEASE. ROHS COMPLIANT
V1 CORRECTED ISSUE WITH OUTPINS AND END COMMANDS
V2 ENHANCED OPERATION OF @PTR, @PTRINC, @PTRDEC
Programming Editor Revisions.
*** Known Restrictions
- Simulation 'Connect' feature not yet available
- Program encrypt Wizard not yet available
- 28X1 'let' mathematical equations cannot yet use brackets
*** End of known restrictions
5.2.0
Added support for 20M
Updated manuals for 20M
Improved Print, Find and Replace operations when in Colour Syntax mode.
Added 'Find Next' Edit menu option. Re-allocated F3 shortcut to 'Find Next'
Improved bookmark operation and added shortcut keys
Improved line number display on document toolbar to show line and column
Added new servopos, pwmduty, hpwmduty commands
Fixed comment colour coding of #rem and #endrem when used in upper case
Corrected compiler issue with use of European accented characters in strings
Amended compiler directive parsing operation for PICAXE VSM compatibility
Corrected the following simulation issues:
- 14M extra ADC (1-2-3) are now simulated via generic panel values
- pulsin varies to 65535 not 4095
- scratchpad variables reset to 0 when program reset
 
Last edited:
Top