microrobotics

Untitled

Feb 13th, 2026
13,538
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Code Example - Arduino Nano Wiring
  2. // SDA → A4    SCL → A5
  3. // VCC → 5V    GND → GND
  4. // This toggles the DAC output between 0V and ~2.5V every second. The value 2048 is half
  5. // of the 12-bit max (4095), giving half the supply voltage.
  6.  
  7. #include <Wire.h>
  8. #include <Adafruit_MCP4725.h>
  9.  
  10. Adafruit_MCP4725 dac;
  11.  
  12. void setup() {
  13.   dac.begin(0x62);
  14. }
  15.  
  16. void loop() {
  17.   dac.setVoltage(2048, false);
  18.   delay(1000);
  19.   dac.setVoltage(0, false);
  20.   delay(1000);
  21. }
Advertisement
Comments
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment