A proper, universally accepted, palindrome date : 2020-02-02 and 02/02/2020.
Last one was 1111-11-11 and 11/11/1111.
Next one will be 2121-12-12 and 12/12/2121.
Missed the last and likely won't be around for the next. A genuine 'once in a lifetime' experience.
The usual approach for determining the absolute value of a two's complement number stored in a word variable is as follows, where the two's complement number is placed in 'w0' with the absolute value result placed in 'w1' -
w0 = -2
If w0 < $8000 Then ; Positive value in w0
w1 = w0
Looking at doing some multi-word maths I realized I had no idea how to actually do binary division, let alone modulo apart from the convoluted mechanism of using the result of the division multiplied then subtracted. That all sounded like a lot of complexity.
So I dived in to finally, after...
Displaying 24, 32, 48 and 64-bit hexadecimal, signed and unsigned decimal values
While greater than 16-bit maths can be relatively straightforward with the right code, showing multi-word numbers as decimal values can be a little complicated.
These routines show how that can be done with a...
Just in case anyone else comes across one of these, happens to be chopping a backhoe or excavator in their yard ...
; SVAB Hydraulik HECR II Hall-Effect Proportional Thumb Roller
; / |
; 5V --.-- |___ |\...
;segment data for TM1637
;( 0 1 2 3 4 5 6 7 8 9 A b C d E F dash blank)
DATA 0,($3f,$06,$5b,$4f,$66,$6d,$7d,$07,$7f,$6f,$77,$7c,$39,$5e,$79,$71, $40, $00)
symbol dio = C.1 ;TM1637 data pin...
Sometimes multiple tasks of a multi-tasking program will desire access to a single resource of the PICAXE; serial, LCD, I2C, PWMOUT, etc. If two or more tasks try to access the same resource simultaneously they can often trample over each other and the outcome will not be as intended.
Macros are a useful tool which PICAXE Editor 6 supports. Macros are quite simple to use once familiar with them and how they work but many people will not be familiar with their use, not clear on how to use them, when or where to use them.
This document is intended to be a brief...
Using This is size N tags, where N can be from 1 to 7 ...
This is size 1
This is size 2
This is size 3
This is size 4
This is size 5
This is size 6
This is size 7
To use for emphasising posted text -
This is normal, This is bold, This is size 5, This is size 6, This is size 7.
So, as an...
Due to the way the pre-processor and syntax checking works within PICAXE Editor 6 there are some tricks which may not be immediately obvious but with a bit of lateral thinking can be put to good use.
For example, having macro style function calls in IF commands, for example -
"Stevenage bomb scare: Small explosion heard after bomb squad attend suspicious ‘coffee cup’ device found"
From the photos it...
Because of the way things are, #MACRO and #IFDEF do not play well together in PICAXE basic. To create a macro which does one thing or another depending on a #DEFINE definition can seem impossible. For example, neither of the following two will pass syntax check -
Microsoft (KB4012598) have taken the step of releasing a security update for older systems; Windows XP, Windows Vista, Windows 8, Windows Server 2003 and 2008, and Windows XP embedded.
We can't personally vouch for the effectiveness of any update or patch but these should protect against the...
The Winstar OLED text modules we stock have a graphics mode. They may not as useful as a true graphics display, because the pixels are segmented into 8x5 character blocks with gaps between them, but they can still display useful graphics and using them graphically allows more than eight user...
This line tracking malarky got me intrigued so here's my take on things.
I am assuming a 128 pixel sensor reading zero ( "no line" ) or non-zero ( "line present" ) values into 128 bytes of scratchpad. Because I don't have a sensor I simply fake a sensor reading which I poke into scratchpad...
This calculates the day of the week from a date.
Based on Zeller's algorithm I think, made as simple as it can be and without optimisation as adding that can make it all a bit confusing and require more temporary variables. The 'dow' value ( 1 to 7 ) is compatible with the value required when...
Here's an early Christmas present.
A neat trick for preserving data when a RESET command is executed and resetting that data to a known initial value when an actual power-cycle reset occurs. All without using EEPROM storage -
Symbol ADRESL = $3B ; $09B...