Questions tagged [analogwrite]
The analogWrite() function is used to generate a PWM (Pulse Width Modulation) output signal on compatible pins.
100 questions
0
votes
0
answers
35
views
Information about PWM frequency
Previously, the reference page for the analogWrite function showed the PWM frequencies for different pins on different Arduino boards, but now it doesn't mention it anywhere... Where is this ...
2
votes
1
answer
172
views
ESP32 LED PWM fade not working?
Not sure if this belongs more in an electronics SE, but I'll give this a try.
I'm trying to use an ESP32-C3 and an NPN transistor (2N5551) to PWM drive an LED (values below). I'm trying a simple fade, ...
0
votes
1
answer
89
views
Is it possible to use analogWrite() using an external Power Supply Unit?
As far as I know, my Arduino Nano can perform analogWrite() ranging from 0 to 1023 for 0 to 5 V respectively, but I want to control a DC motor which requires 9 V for good performance. Is it possible ...
1
vote
1
answer
86
views
When I use AnalogueWrite the voltage doesn't vary properly
I have a project where I want to control a pump, I use an Arduino, connected to a driver L298N and I will connect the pin 5, 6, 7 of the arduino to the pin IN2, IN1, ENA of the driver respectively and ...
-1
votes
1
answer
772
views
What should happen when sending analogWrite signal to a non-PWM pin?
I'm a very new to Arduino and any electrical engineering, I'm learning through some Youtube tutorials.
Based on my understanding though, sending analog signals to a non-PWM pin would just check for a ...
0
votes
1
answer
208
views
How to control PWM and digital pins at the same time over ethernet in arduino
I am using Controllino Maxi. It has an Arduino Uno inside it. I am trying to control the PWM pin D0 and digital pin R0 via python code. Below is the code I have upload on arduino:
Arduino Code:
#...
1
vote
1
answer
89
views
IF statement to run even if the requirement isn't met anymore
I have built a flasher for the headlamps on my race car. Whilst it works when I hold the switch down, if I release the switch and the circuit is closed my IF statements requirements are no longer met ...
2
votes
2
answers
654
views
Arduino fade in/out 5 leds circuit acting wierd
I have a simple arduino project with 5 leds, the project should start with led 1 fade through 50 millisec to reach full brightness, then led 2 and so on until led 5 then turn them all off and loop.
...
0
votes
1
answer
3k
views
Random "Compilation error: Error: 13 INTERNAL: exit status 1". No clue how to resolve or even what causes this error
I am a beginner with Arduino. I have a program that is intentionally simple.
The code refuses to compile, spitting out the error Compilation error: Error: 13 INTERNAL: exit status 1. I have gotten ...
2
votes
1
answer
368
views
Getting constant PWM value based on user input from serial monitor
I am trying to get a constant PWM value from the PWM pin based on the user input. For example: the user hits 1, the output PWM value is 100, if it is 2 the output would be 200. This will continue till ...
1
vote
1
answer
1k
views
Writing multiple inputs to serial port using a while loop
I am trying to get the serial monitor to prompt me to input two settings - the PWM level and the Resonance level. I am being prompted to input the PWM level, but before I can input the Resonance level ...
0
votes
1
answer
138
views
How fast does the Arduino execute code?
I am using the Arduino Nano every. Take this example where I am measuring two things A and B.
Loop{// this loop runs once every second
//Read A,B
//Change something using analogueWrite which ...
0
votes
1
answer
120
views
Check pin capabilities at compile time
Are there board-independent functions to check pin capabilities at compile time? I.e.
Can the pin be used as output, as in digitalWrite()?
Does the pin support PWM, as in analogWrite()?
Does the pin ...
1
vote
1
answer
4k
views
Why do I need to use latin-1 instead of utf-8 when using python with arduino?
When reading and writing with a python serial port connection to arduino, if I don't use latin-1 ('ISO-8859-1'), the results are not as expected. Like if I have
int outP = 5;
//...
int outV = Serial....
1
vote
0
answers
64
views
Phantom reading
my project is to control led diode and dc motor, test shield buttons, and check system run time.
Testing buttons and run time i have done.
Deal is with led and dc motor control.
I'm getting phantom ...