B bluejets Senior Member Nov 5, 2012 #1 In the example code I found, does the W1 register become over written on each loop..?? Code: main: pulsin C.3,1,w1 ; record the length of a pulse on C.3 into w1 debug ; report the result goto main ; and repeat
In the example code I found, does the W1 register become over written on each loop..?? Code: main: pulsin C.3,1,w1 ; record the length of a pulse on C.3 into w1 debug ; report the result goto main ; and repeat
M MartinM57 Moderator Nov 5, 2012 #2 Yes, but it may be overwritten with the same value of course. It would be really odd if it didn't Why do you ask?
Yes, but it may be overwritten with the same value of course. It would be really odd if it didn't Why do you ask?
G Goeytex Senior Member Nov 5, 2012 #3 W1 will indeed be overwritten on each loop. To see it work, have a second Picaxe send incrementing value pulses to the first. Code: [FONT=Courier New]Do for w0 = 1000 to 10000 step 100 pulsout c.1,w0 pause 200 next loop [/FONT] The pulsin / pulsout values should match assuming both Picaxe's are operating at the same frequency.
W1 will indeed be overwritten on each loop. To see it work, have a second Picaxe send incrementing value pulses to the first. Code: [FONT=Courier New]Do for w0 = 1000 to 10000 step 100 pulsout c.1,w0 pause 200 next loop [/FONT] The pulsin / pulsout values should match assuming both Picaxe's are operating at the same frequency.
B bluejets Senior Member Nov 5, 2012 #4 Ok...thanks.....wasn't sure if it needed to be reset. I couldn't find anything about the need to reset but thought I'd ask just in case. Thanks again.
Ok...thanks.....wasn't sure if it needed to be reset. I couldn't find anything about the need to reset but thought I'd ask just in case. Thanks again.