-
• #2
Try analogWrite(A5,0.5,{freq:35000});
This should give you a 50% duty cycle. -
• #3
This link might help. Note it uses a 0.9 duty cycle.
http://www.espruino.com/Pico+Infrared
Since you don't have a scope you might try this one liner to see the LED flashing.
analogWrite(A5,0.5,{freq:0.5});
It uses a lower frequency so you can see the flashes.I did this one liner to flash the Green LED on a Pico. This is not PWM pin so you have to use the software PWM. PWM pins use the Timer peripherals built into the ARM chip.
analogWrite(B12,0.5,{freq:0.5,soft:true}); -
• #4
ahhh the duty cycle, that was my problem, thank you!
I also had to replace the initial start value with 0.
analogWrite(A5, 0.5,{freq: 35000}); digitalPulse(A6, 0, command); digitalPulse(A6, 1, 0);
-
• #5
Isn't the right frequency 38000 Hz?
As @ClearMemory041063 said there's some example code at http://www.espruino.com/Pico+Infrared
The start value will depend on which way you put the IR transmitter between the 2 pins :)
It might also be handy to make the duty cycle 0.9 as in the example now you're pulling down to turn on. It means the LED is then only on for 10% of the time - which means you can use lower resistor values to drive it with more power without risking breaking it. Also I think it's closer to what the IR receivers expect.
But hey, if it's working :) Also, for turning off, just try
digitalRead(A5)
- it'll put the pin into an input state
Hello,
I'm having some trouble getting infrared to correctly transmit from the Pico. Using the same PWM data (microseconds) and components I'm able to see it working using an arduino.
The Pico is running 1v87 and I was unable to get the Pico infrared example transmitting (receiving is working and also reads the same values as the arudino).
Minimal arduino sketch based on Arduino-IRremote
Pico code
Unfortunately I don't have an oscilloscope at hand to see what A5/A6 are actually outputting :(
Am I missing something obvious?
Thanks!