Created
September 19, 2012 16:44
-
-
Save xseignard/3750697 to your computer and use it in GitHub Desktop.
38kHz signal with breakout js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arduino.setDigitalPinMode(11, Pin.PWM); | |
var led = arduino.getDigitalPin(11); | |
console.log(led); | |
var freq = 0.000026316; // 38kHz = 38000 cycles per seconds = 38000^-1 seconds per cycle = 0.000026316 seconds per cycle | |
var amplitude = 2.0; | |
var offset = 0; | |
var phase = 0; | |
var repeat = 0; | |
var sinewave = new Oscillator(Oscillator.SIN, freq, amplitude, offset, phase, repeat); | |
led.addGenerator(sinewave); | |
sinewave.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment