So I am designing a wired fencing scoring system. There already exists an arduino based analog wired scoring system, however the analog system has a few fundamental problems.
A quick explanation of fencing scoring machines. There are three different weapons; however, I will only talk about foil since that addresses the difficult problems that if solved then also solve the other weapons. In foil there are two fencers with three wires that go into the box for each fencer. I will call the three wires line A, line B and line C. Line A is connected to the fencers lame (a metalic vest which is considered valid target area). Line B is connected to a wire that goes to the end of the weapon and into a button. Line C is connected to the weapon's blade. If line B and line C complete a circuit then the button is not depressed. Once line B and C break (open circuit) then the button is pressed. The end of the button is insulated from line C and is only connected to line B. If the button touches the opponent then line B will complete a circuit with line C of the opponent (that is considered a valid touch).
So I want to make this system of detecting if the lame is touched a digital and not analog, because in an analog system there is no way of distinguishing which fencer the incoming voltage to line C is coming from. The only solution is to send different voltages, however those voltages can change with different resistance values of the fencers blade and body cord which is not a controlled variable.
I found a solution to this problem in a digital system.
If I send two different PWM signals from the two different fencers I just have to read the PWM signal touching the lame. I know if the button is pressed or not, and if the button is pressed on the first fencer and the first fencers PWM signal is going into the lame of the second fencer or if a combination of those two are coming into the second fencers lame then it is a valid touch.
I've attached a picture of what the two signals would need to be and what the combination would look like. The two signals need to synchronized, which shouldn't be hard if I use the same timer to generate the signals. The arduino nano (which is what I am using shares pin 9 and 10 on the same timer).
My question is how would I tell the arduino to generate those two signals?
The only way I know how to create a PWM signal is using analogWrite(). Which from my understanding specifies the duty cycle.
Can anyone help?
EDIT: It wouldn't let me upload the image as an attachment, so here is a link to it on imgur