err. messsage when downloading programs for picaxe m types to picaxe m2 types

A short time ago I published a picaxe 14m project for position- landing- and anticollision-lights in an airplane model construction magazine . Some people who build that module told me, that the program which I made available for download would not work. The problem was, that my program was written for a picaxe 14m and they downloaded it to a picaxe 14m2. Neither the syntax checker nor the download of the PE gave any error message, so that everybody thought, that the program is wrong, because it did not work. All runs well after changing the pin notation according to the new pinout diagrams of m2 types.
Therefore the following suggestion:
The syntax checker as well as the PE during download should give an error message, when you download a program with old pin notation to new picaxe type m2.
 
Code:
#rem
Blinkmodul für Flugmodelle
Version PICAXE 14m

Impulse für Kanal 7 - 3fach Schalter meiner MC 16:

Schalterstellung Aus: 107
Schalterstellung Mitte: 149
Schalterstellung Ein: 191

#endrem

symbol servo_eingang = 1
symbol servo_impuls = w0
symbol servo_mitte = 148
symbol servo_max = 190

symbol zeit = w1

symbol rot_ein = 0
symbol rot_aus = 800
symbol gruen_ein = 500
symbol gruen_aus = 300
symbol acl_ein1 = 100
symbol acl_aus1 = 200
symbol acl_ein2 = 400
symbol acl_aus2 = 500

symbol rot = 1
symbol gruen = 2
symbol acl = 3
symbol lsw = 4


start:
pulsin servo_eingang,1,servo_impuls
'debug
if servo_impuls >= servo_max then
    high lsw
  else
    low lsw
end if
if servo_impuls > servo_mitte then
for zeit = 0 to 900 step 50
  if zeit = rot_ein then
    high rot
  endif
  if zeit = rot_aus then
    low rot
  endif
  if zeit = gruen_ein then
    high gruen
  endif
  if zeit = gruen_aus then
    low gruen
  endif
  if zeit = acl_ein1 then
    high acl
  endif
  if zeit = acl_aus1 then
    low acl
  endif
  if zeit = acl_ein2 then
    high acl
  endif
  if zeit = acl_aus2 then
    low acl
  endif
  pause 50
  next zeit
  goto start
else
  low gruen
  low rot
  pause 50	
end if
goto start
 

hippy

Ex-Staff (retired)
The best way to ensure a PICAXE program for a specific device is not used with a different PICAXE is to add a #PICAXE Directive at the top of the program. This will cause an error message to be raised whenever an attempt to download the program into the wrong PICAXE is made ...

#Picaxe 14M

Additionally a check can be included in the program to help guard against users simply deleting the #PICAXE directive and expecting it to work ...

#Ifndef 14M
#Error "This program is only to be used with a PICAXE-14M"
#EndIf
 

Technical

Technical Support
Staff member
Or simply change the offending line, as it would work on the old 14M and new 14M2 if in this format

symbol servo_eingang = C.1
 
Top