Hello All, I really would appreciate your thoughts, even if it’s to tell me my code is rubbish and that I should take up fishing, so here goes .
My Hobby is Meccano modelling.
First what am I trying to do? I am trying to use infrared to control a Meccano model crane.
-----------------------
I am trying to replace a standard TV remote control, with a Transmitter that is more “authentic” to Meccano. I have in mind a meccano box housing the Transmitter with input switches operated by levers. My Transmitter has eight channels using Picaxe20X2.
-------------------------
The Receiver Circuit is Picaxe20X2 and is attached to a crane controlling four motors forwards and reverse. The model works perfectly using a standard TV remote control, so I think the receiver circuit is OK.
My Transmitter (that’s where my problems start) is made using a Picaxe project board AXE118 fitted with Picaxe 20X2.and an IFLED.
Reading the Mauals,Tutorial, Post, and Code snippets, I came up with this code.
This Transmitter code works! It will control four motors forwards and reverse.
So what’s the problem?
1, Pause is a problem. I would like to increase the pause time (to 45ms) but if the pause time is increased ,then the IF transmission is interrupted and the Motor will also pause. I have reduced the pause time in the code, so that the Motor “visibly” does not pause, I could live with this but it does seem a bit of a “copout”.
2, Range is a problem. The reliable range is less than One meter .
To increase the range I have connected Two IRLEDs in series and reduced the resister from 220r to 150r (Tutorial) this has improved the Target giving a better spread, but the range is much the same.
I am just going to put the Maggots in the Fridge , Thanks for your thoughts . Ernest
My Hobby is Meccano modelling.
First what am I trying to do? I am trying to use infrared to control a Meccano model crane.
-----------------------
I am trying to replace a standard TV remote control, with a Transmitter that is more “authentic” to Meccano. I have in mind a meccano box housing the Transmitter with input switches operated by levers. My Transmitter has eight channels using Picaxe20X2.
-------------------------
The Receiver Circuit is Picaxe20X2 and is attached to a crane controlling four motors forwards and reverse. The model works perfectly using a standard TV remote control, so I think the receiver circuit is OK.
My Transmitter (that’s where my problems start) is made using a Picaxe project board AXE118 fitted with Picaxe 20X2.and an IFLED.
Reading the Mauals,Tutorial, Post, and Code snippets, I came up with this code.
This Transmitter code works! It will control four motors forwards and reverse.
So what’s the problem?
1, Pause is a problem. I would like to increase the pause time (to 45ms) but if the pause time is increased ,then the IF transmission is interrupted and the Motor will also pause. I have reduced the pause time in the code, so that the Motor “visibly” does not pause, I could live with this but it does seem a bit of a “copout”.
2, Range is a problem. The reliable range is less than One meter .
To increase the range I have connected Two IRLEDs in series and reduced the resister from 220r to 150r (Tutorial) this has improved the Target giving a better spread, but the range is much the same.
I am just going to put the Maggots in the Fridge , Thanks for your thoughts . Ernest
Code:
#PICAXE 20X2
SYMBOL Countr =b10
start:
if pinc.0=1 then gosub ir0
if pinc.1=1 then gosub ir1
if pinc.2=1 then gosub ir2
goto start
end
ir0:
For countr =1 to 3 'loop 3 time in case receiver misses first pass
irout 0,1,0
NEXT Countr
PAUSE 18
if pinc.0=1 then ir0
return
ir1:
For countr =1 to 3
irout 0,1,1
NEXT Countr
PAUSE 18
if pinc.1=1 then ir1
return
ir2:
For countr =1 to 7
irout 0,1,2
NEXT Countr
PAUSE 18
if pinc.2=1 then ir2
return
'This is repeated for Eight outputs.
Last edited by a moderator: