Skip to content

GIGA: analogWrite to DAC pins (A12, A13) does not appear to be implemented. #38

Closed
@KurtE

Description

@KurtE

At one point I thought I saw some DAC code in place, but now I don't see it:

Tried simple sketch:

int sensorPin = A0;   // select the input pin for the potentiometer
int sensorValue = 0;  // variable to store the value coming from the sensor
int sensorValuePrev = -1;

int DACPin = A12;
void setup() {
  // put your setup code here, to run once:
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:
  sensorValue = analogRead(sensorPin);
  if (sensorValue != sensorValuePrev) {
    digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
    analogWrite(DACPin, sensorValue);
    Serial.println(sensorValue);
    sensorValuePrev = sensorValue;
  }
  delay(100);
}

Which faulted the processor. As A12 was not found in the list of PWM pins. This is covered in issue #19
Note: I pushed up a fix for the fault as part of my current PR: #32

Now need to see what code should be added to support this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions