Hi,
I've searched forums, manuals etc but am stuck. Bit of a beginner so I hope I can be clear...
On my prototype I've a 20m2 performing actions based on a value it gets from a 14m2 via serin. I now wish to use a 20x2 in place of the 20m2 but the 20x2 refuses to work when I do a straight swap.
I have removed most of my code to test where the problem is and am still stuck.
The below test code works perfectly with the 20m2 but not 20x2. It uses an interrupt to blink an LED based on the val value received from the 14m2. Am I missing something obvious? The interrupt from the 14m2 is coming in on pin C.1
The reason I want to use a 20x2 is because I read elsewhere on this forum the x2 would be better to read MIDI which is the next step on my project.
Thanks in advance,
Sam
I've searched forums, manuals etc but am stuck. Bit of a beginner so I hope I can be clear...
On my prototype I've a 20m2 performing actions based on a value it gets from a 14m2 via serin. I now wish to use a 20x2 in place of the 20m2 but the 20x2 refuses to work when I do a straight swap.
I have removed most of my code to test where the problem is and am still stuck.
The below test code works perfectly with the 20m2 but not 20x2. It uses an interrupt to blink an LED based on the val value received from the 14m2. Am I missing something obvious? The interrupt from the 14m2 is coming in on pin C.1
The reason I want to use a 20x2 is because I read elsewhere on this forum the x2 would be better to read MIDI which is the next step on my project.
Thanks in advance,
Sam
Code:
#picaxe 20x2 'change as necessary
symbol val = b1
symbol num = b2
main:
let val = 0
let num = 0
setint %00000010, %00000010, C
stop
interrupt:
high C.7 ' send RTR message to other chip
serin C.0, N2400, val ' get the message
gosub SendOutput 'act on the message
low C.7 ' clear RTR message to other chip to confirm message received
do pause 5 loop until pinc.1 = 0 'wait to see that other chip has closed RTS message
setint %00000010, %00000010, C ' reset the interrupt
return
SendOutput:
for num = 1 to val step 1
high B.1
pause 100
low B.1
pause 100
next num
return