Help needed on 8m2 code

Visser

Well-known member
Good day
I need to convert this simple code from Picaxe 08M to Picaxe 08M2 Can someone please help. It does not like when I replace PIN3 with C.3 etc.
Regards
Vissie

#Picaxe 08M
#No_Data
DO
SYMBOL SENSEPIN = PIN3
IF SENSEPIN = 1 THEN
pwmout 2 , 3 , 7
ELSE
pwmout 2 , OFF
END IF
LOOP
 
Hi,

AFAIK the program hardly needs converting, but to convert to the later "Port.Pin" names from the older "number only" names, you just need to replace the "numbers" with the Port.Pin, for example PWMOUT 2 , ... becomes PWMOUT C.2 , ... . However, for certain Input names the original structure was PinN which must be replaced by PinC.N for example IF Pin3 = 1 THEN ... becomes IF PINC.3 = 1 THEN ... , so the Symbol line would be SYMBOL SENSEPIN = PINC.3 .

Cheers, Alan.
 
Hi Is there any way to run this code on a higher frequency.
#Picaxe 08M2
#No_Data
DO
SYMBOL SENSEPIN = PINC.3 ;pulse at top @ bottom off sine wave
IF SENSEPIN = 1 THEN ;
pwmout C.2, 19, 39 ;pulse 10Khs 50% duty
ELSE
PWMOUT C.2 , OFF
END IF
LOOP
I'm getting 1 msec delays on the pwm signal pulse and it looks like its drifting but that could be my ancient scope
Will order a small a digital scope now
Regards
Vissie
 
Back
Top