From 136f6b389b024bd34378eb10c953cb5f919d00fe Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Sat, 26 Oct 2024 18:17:04 +1100 Subject: [PATCH] Removed delay --- 02LogisticAR/LogisticAR.ino | 41 ------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 02LogisticAR/LogisticAR.ino diff --git a/02LogisticAR/LogisticAR.ino b/02LogisticAR/LogisticAR.ino deleted file mode 100644 index f764b67..0000000 --- a/02LogisticAR/LogisticAR.ino +++ /dev/null @@ -1,41 +0,0 @@ -// Basic demo for configuring the MCP4728 4-Channel 12-bit I2C DAC -#include -#include - -Adafruit_MCP4728 mcp; - -float xlog = 0.5; -float r = 3.783423; - -void setup(void) { - Serial.begin(115200); - while (!Serial) - delay(10); // will pause Zero, Leonardo, etc until serial console opens - - Serial.println("Adafruit MCP4728 test!"); - - // Try to initialize! - if (!mcp.begin(0x64)) { - Serial.println("Failed to find MCP4728 chip"); - while (1) { - delay(10); - } - } - - mcp.setChannelValue(MCP4728_CHANNEL_A, 4095); - mcp.setChannelValue(MCP4728_CHANNEL_B, 2048); - mcp.setChannelValue(MCP4728_CHANNEL_C, 1024); - mcp.setChannelValue(MCP4728_CHANNEL_D, 0); - - -} - - -void loop() { - int pot = analogRead(A0); - r = (float)pot / 1024.0 + 3.0; - xlog = r * xlog * (1 - xlog); - int cv = round(xlog * 4095.0); - mcp.setChannelValue(MCP4728_CHANNEL_A, cv); -// delay(100); -}