My first post here, I look forward to joining this amazing community. I think Lady Ada is a star, kick-starting an electronics empire from an MIT dorm-room... how kick-ass is that?
Anyways:
I have a 3.3V Trinket M0 that I am programming with the Arduino IDE.
From the docs, I understand that Trinket M0 has a 10 bit DAC.
So to set up, I do:
Code: Select all
// the setup function runs once when you press reset or power the board
void setup()
{
pinMode(PIN_A0, OUTPUT);
analogWriteResolution(10);
while (!Serial) ; // Wait for serial port to become ready.
Serial.println("Trinket M0 is ready.");
}
Code: Select all
// the loop function runs over and over again forever
void loop()
{
static int cnt=0;
cnt += 1;
analogWrite( PIN_A0, (cnt&1) ? 0x3ff : 0x000 );
delay(2000);
}
* 0.0V
* 2.2V
I did not expect to see 2.2V. When I write the max analog value to A0, should I not see 3.3V instead?
The 2.2V is not enough to trigger my mosfet gate, that I have in my circuit, and I don't understand why A0 cannot output 3.3 volts.
Thanks!