Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not outputting correct voltage #10

Open
adamelli opened this issue Dec 8, 2020 · 2 comments
Open

Not outputting correct voltage #10

adamelli opened this issue Dec 8, 2020 · 2 comments

Comments

@adamelli
Copy link

adamelli commented Dec 8, 2020

#include <Arduino.h>
#include <analogWrite.h>

int brightStep = 1;
int brightness = 0;
uint8_t ledR = 34;
uint8_t ledG = 35;
uint8_t ledB = 32;
uint8_t ledW = 33;

void setup()
{

  // Set resolution for a specific pin
  analogWriteResolution(ledR, 12);
  analogWriteResolution(ledG, 12);
  analogWriteResolution(ledB, 12);
  analogWriteResolution(ledW, 12);

  analogWrite(ledR, 255);
  analogWrite(ledG, 255);  
  analogWrite(ledB, 255);
  analogWrite(ledW, 255);
 
}

void loop() {}

This outputs
ledR = 0 = GPIO34
ledG = 0 = GPIO35
ledB = 1.6 V = GPIO32
ledW = 1.6 V = GPIO33

Why?

@adamelli
Copy link
Author

adamelli commented Dec 8, 2020

So pins 34, 35, 36, 39 are input only. That does not explain why the other pins only output a maximum of 1.65 V...

@JimDrewGH
Copy link

If you are measuring PWM with a standard VOM this would be normal. The duty cycle will throw off a conventional VOM. Set a pin HIGH and measure the voltage. If it's still just 1.65V then that would be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants