Good afternoon,
I looked into jpigpio, it should do the job for java with very few differences than the original gpio C library.
Now, I'm trying to understand further the mechanism to generate waves.
Here is what I understand from your example :
1 - You create a wave form (is wvag = wave add generic ?)
2 - You use wave create to give this form an ID. The first is supposed to be ID 0.
3 - You do the same for a second wave form, then give it ID 1
4 - You send several waves, calling them with their ID.
I don't really understand the arguments you use in wvag.
I found this piece of code in GPIO documentation :
Code: Select all
G1=4
G2=24
pi.set_mode(G1, pigpio.OUTPUT)
pi.set_mode(G2, pigpio.OUTPUT)
flash_500=[] # flash every 500 ms
flash_100=[] # flash every 100 ms
# ON OFF DELAY
flash_500.append(pigpio.pulse(1<<G1, 1<<G2, 500000))
flash_500.append(pigpio.pulse(1<<G2, 1<<G1, 500000))
flash_100.append(pigpio.pulse(1<<G1, 1<<G2, 100000))
flash_100.append(pigpio.pulse(1<<G2, 1<<G1, 100000))
pi.wave_clear() # clear any existing waveforms
pi.wave_add_generic(flash_500) # 500 ms flashes
f500 = pi.wave_create() # create and save id
pi.wave_add_generic(flash_100) # 100 ms flashes
f100 = pi.wave_create() # create and save id
In the example you gave above, in wvag, you set 16 0 58, then 0 16 58. It looks similar, but I don't understand how to choose the parameters ...
I only understood that the last one was delay, and therefore the width of the wave
Thank you for your help !