Created
April 12, 2018 13:57
-
-
Save lithium/b67d50e1ff22a7e8638aad9f92eb245c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #include <Wire.h> | |
| #include <Adafruit_MCP4725.h> | |
| Adafruit_MCP4725 dac; | |
| #define GATE_PIN 12 | |
| void setup() { | |
| dac.begin(0x62); | |
| dac.setVoltage(0, 0); | |
| } | |
| void loop() { | |
| uint16_t v = random(0, 65535); | |
| dac.setVoltage(v, 0); | |
| digitalWrite(GATE_PIN, 1); | |
| delay(500+random(0,500)); | |
| digitalWrite(GATE_PIN, 0); | |
| delay(500+random(0,500)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment