Skip to main content

Questions tagged [analogwrite]

The analogWrite() function is used to generate a PWM (Pulse Width Modulation) output signal on compatible pins.

Filter by
Sorted by
Tagged with
0 votes
1 answer
93 views

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 ...
Jazz Weisman's user avatar
2 votes
1 answer
251 views

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, ...
Lorenzo's user avatar
  • 149
0 votes
1 answer
95 views

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 ...
Tapan Gupta's user avatar
1 vote
1 answer
101 views

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 ...
Nept0's user avatar
  • 13
-1 votes
1 answer
810 views

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 ...
BlueStarXD's user avatar
0 votes
1 answer
226 views

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: #...
S Andrew's user avatar
  • 183
1 vote
1 answer
98 views

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 ...
dav0s's user avatar
  • 13
2 votes
2 answers
713 views

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. ...
AhmedH2O's user avatar
  • 123
0 votes
1 answer
3k views

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 ...
Jacob Ivanov's user avatar
2 votes
1 answer
387 views

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 ...
Dave's user avatar
  • 69
1 vote
1 answer
1k views

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 ...
PrematureCorn's user avatar
0 votes
1 answer
149 views

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 ...
fred's user avatar
  • 101
0 votes
1 answer
141 views

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 ...
Dmitry Grigoryev's user avatar
1 vote
1 answer
4k views

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....
user avatar
1 vote
0 answers
70 views

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 ...
Jānis's user avatar
  • 59
-1 votes
1 answer
2k views

Im a complete beginner Im making a project using relay modules and arduino. but all the digital pins of my arduino are filled. I wanted to ask if i can use the analog pins to connect my relay module ...
rohithrathod banoth's user avatar
2 votes
1 answer
289 views

I'm essentially trying to create a music box which is light activated using an LDR. When it's open a song plays, while a servo rotates a figurine back and forth, and an LED dims and illuminates in ...
TonyStark's user avatar
2 votes
1 answer
132 views

I am just starting to learn bitwise operands and here is my question. To do this: pinMode (13, OUTPUT); digitalWrite (13, HIGH); bitwise I can do like this: DDRB |= B00100000; //set PIN13 as ...
wotesi's user avatar
  • 123
0 votes
1 answer
1k views

This question is very similar to this one. I'm using an ESP8266 for which the maximum analogWrite value is 1023 rather than 255 for some other Arduino boards, but I believe the principal is just the ...
Peter Jennings's user avatar
2 votes
0 answers
76 views

So, I have this code (Arduino Mega): void setup() { pinMode(10, OUTPUT); pinMode(11, OUTPUT); pinMode(6, OUTPUT); analogWrite(10, 50); analogWrite(11, 50); } very basic motor speed control....
Name's user avatar
  • 135
0 votes
2 answers
449 views

I am not really 100% too sure how to do this but I am trying to make my arduino UNO communicate with my arduino MEGA. The reason why I needed to do this was because I was using the RFID module along ...
The_Indestructible_Cat's user avatar
1 vote
0 answers
110 views

I am using teensy 2.0 as DAC. I am trying to write signals on rudder and throttle of the ship via relay. How can I write these analog signals? Should I specify voltage for every pin? Here is my code: ...
Fourier's user avatar
  • 11
0 votes
4 answers
2k views

If I have two output pins, one set high and the other set low with digital or analog write like this digitalWrite(PIN1, LOW); digtialWrite(PIN2, HIGH); and then I short them together using a wire, ...
Mark's user avatar
  • 197
4 votes
1 answer
572 views

I'm using Windows 10, Arduino 1.8.12 (Windows Store 1.8.33.0) I have an Arduino MEGA 2560 and a red LED connected to pin 4. #define RED 4 #define GREEN 2 void setup() { analogWrite(GREEN, 0); ...
Mark's user avatar
  • 197
1 vote
1 answer
2k views

I've been trying, just out of curiosity, to write my own function that generates a PWM signal, just like analogWrite(), and to make it light up an LED. Here's my attempt so far: const int pin = 3; ...
Vinícius Peixoto's user avatar
-1 votes
1 answer
1k views

I'm just lighting up an LED through a TIP31C, pin 0 goes through a 560kohm resistor to the tip's input pin pin 1 goes through a 750 ohm resistor to the tip's input pin ^i'm not sure this information ...
Valkor Simpson's user avatar
2 votes
1 answer
317 views

Well just as the question say, is the analogWrite() function will continue generating near-consistent PWM when it encounters blocking codes or signal interrupts? Is it the same case for both the ...
Jack's user avatar
  • 223
1 vote
0 answers
471 views

I wrote the following code that outputs a packet data structure bit by bit. I do this using two for loops. These two for loops should always terminate, but the presence of analogWrite() makes them ...
MonsieurRisch's user avatar
1 vote
1 answer
3k views

I created a simple circuit with an UNO, L298N and a single motor. Wrote the following code to test controlling the speed of the motor. Tested motor with digitalWrite() function and it works fine. ...
yannism's user avatar
  • 21
1 vote
1 answer
465 views

I have connected DRV8835 with 2 DC motors with 11 power supply. Arduino nano. When I for loop like i from 0 to 1024 for analogWrite(i,Motor1) for the DC Motor1 it's accelerating from 0 to 200 and it'...
Lary's user avatar
  • 13
0 votes
1 answer
389 views

Ardiuno Mega 2560 I have a legacy PCB that connects PORTA, pins = {22, 23, 24, 25, 26, 27, 28, 29} to the PWM input of a set of actuators. The accompanying code made use of an interupt service ...
DrBwts's user avatar
  • 161
0 votes
2 answers
302 views

I have developed a circuit to process the PMT pulse output. For the testing, I need an artificial signal which is similar to the PMT pulse. How can I use AnalogWrite() to create such type of signal?
krishnamoorthi jayakumar's user avatar
1 vote
1 answer
377 views

So I have and arduino uno that is firing an output on pin 8. This code is not in this file just to be clear. From there Im taking that output and using it to fire pin 0 on the wifi module. Im using ...
user52703's user avatar
0 votes
1 answer
606 views

I'm trying to generate dim two LED strips simultaneously by generating two PWM signals based on potentionmeter value. The pot sets how bright each of the LED strips will be. To drive this I'm using ...
jnovacho's user avatar
  • 235
0 votes
3 answers
12k views

I have a YL-44/MH-FMD passive piezo buzzer hooked up to an ESP8266/NodeMCU. It's connected like this: Buzzer ---> NodeMCU - GND ---> G - VCC ---> 3V - I/O ---> D2 This code makes a clear beep. ...
Sir Rubberduck's user avatar
1 vote
1 answer
233 views

im a newcomer for arduino and sorry for any grammar error. So what im trying to do is replicating a flickering effect found on spacecraft thruster when they about to take off where the fire bursting ...
user194312's user avatar
0 votes
1 answer
2k views

So I need to automaically eject a CD from a Blu-Ray drive, I have a wire welded on the drive's card that if manually connected for a split second (pulse) to the ground of that same card on the drive, ...
SalmaG's user avatar
  • 3
7 votes
2 answers
253 views

I'm building a puzzle for an escape room. I want to give the user 6 wires and 6 terminals, then confirm that they've connected the correct wires to the correct terminals (one-to-one). My first (...
Jonathan Dautrich's user avatar
3 votes
4 answers
9k views

Can we write a analog voltage to analog pins A0-A7 of the Arduino Nano (for example)? As in: pinMode(A3, OUTPUT); analogWrite(A3, 200);
Jarvis1997's user avatar
3 votes
1 answer
894 views

TL;DR: My Arduino is injecting a lot of noise into an analogue audio circuit, even when not physically connected. I'm experimenting with using an Arduino as a low-frequency oscillator in audio ...
helveticat's user avatar
0 votes
2 answers
6k views

I know there are a lot of questions about this topic, but I've tried everything and any possible guide online without success. I want dim (increase and decrease the brightness) some leds (3.5 Watt ...
xdola's user avatar
  • 103
1 vote
2 answers
2k views

I'm working on a bigger project, and needs to give out a voltages between 0 and 5V. I've written this code: int ledPin = 12; // LED connected to digital pin void setup(){ pinMode(ledPin, ...
Erlend Salte Kallelid's user avatar
-1 votes
1 answer
3k views

I am using an Arduino DUE. Using the analogWrite(DAC0, X) command I am writing an analog value to this pin. X = 0 - 255 as I understand it. I am observing that when X is lower, the voltage on DAC0 ...
user avatar
0 votes
1 answer
641 views

I'm working on some code for a Nerf blaster with an LED indicator light. When attempting to use analogWrite to PWM my LED pins, only one pin (blue) behaves as expected and dims down. The other two (...
jjumbc's user avatar
  • 1
1 vote
1 answer
404 views

I am trying to create an AC voltage in Arduino. Until now I have only managed to get a square wave. How can this be achieved with Arduino? If I try: int up; int down; int out = 11; void setup() { ...
Anonymous's user avatar
  • 111
1 vote
2 answers
7k views

I have Arduino Uno and I attached it to 2 DC motors with L298N bridge. I want to control the speed of the motors so they don't move at maximum speed. I use analogWrite() but it does nothing,and the ...
Mustafa Mohamed's user avatar
0 votes
1 answer
295 views

I used a servo as a grabber so I don't know the angle I need specifically.I need it to break the serve.write(angle) when the grabber holds something. I used a simple code #include <Servo.h> ...
Mostafa Rady's user avatar
2 votes
3 answers
2k views

I have a system which requires me to obtain different duty cycles at different frequencies. But using the analogWrite() does not allow me to obtain a value lower than 1/255 duty cycle. I need to ...
allta's user avatar
  • 23
2 votes
2 answers
257 views

I am working on trying to make a LED strip respond to natural Light levels for a sculpture. I have reached a problem in trying to get the code to work when sending PWM to the light strip. Thank you ...
David's user avatar
  • 29
1 vote
3 answers
3k views

I am having a hard time understanding why I can't read one analog pin's output with another analog pin. The docs state to put a delay in between, which I've done (I've tried up to one second with the ...
stevieb's user avatar
  • 296