Skip to main content

Questions tagged [digitalwrite]

Write a HIGH or a LOW value to a digital pin.

Filter by
Sorted by
Tagged with
2 votes
2 answers
863 views

I've got a LattePanda 3 Delta, which runs windows on its main processor and an Arduino sketch called StandardFirmata on its coprocessor. It's connected to a lock, which locks at HIGH and unlocks at ...
Josmund's user avatar
  • 21
2 votes
2 answers
404 views

I am trying to use an esp32 (NodeMCU-32s) as a ringlight controller for my camera. All it should do is sense when an input pin goes low (the camera's output connects to ground when the shutter goes ...
Zach's user avatar
  • 21
0 votes
1 answer
471 views

When I was testing out a program I found a strange behavior of ESP8266. LEDs don't turn off completely in the first digitalWrite(led, LOW), just the brightness of the LED goes down, but it does turn ...
tatu101's user avatar
  • 73
1 vote
1 answer
187 views

I have a device programmable via an 8 bit digital parallel bus. I would like an Arduino to translate from a parallel 4 bit output of an existing device to 8 bit by intentionally reducing the ...
P. Egli's user avatar
  • 121
1 vote
2 answers
118 views

Consider this code: void loop() { digitalWrite(pinTest, HIGH); digitalWrite(pinTest, LOW); } On an Arduino Mega 2560, running 16MHz (=0.06us), I would expect the width of the pulse to be ...
Bart Friederichs's user avatar
0 votes
1 answer
215 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
0 votes
2 answers
464 views

I'm working on a Home Automation Project. I can turn on-off ESP32 pin from Alexa and Google Assistant Successfully now. What I need help is with a way to read if the AC supply is ON/OFF on the Arduino ...
Just doin Gods work's user avatar
0 votes
1 answer
170 views

I'm using an arduino uno R3 for lighting a few LEDs in response to coputer control. I've written two programs, the first to try an Object Oriented style, and the second to split up the code into more ...
MCR's user avatar
  • 3
2 votes
0 answers
204 views

so i recently got an arduino micro for a project needing the control of two stepper motors with the A4988 driver. previously i was prototyping on an arduino uno and everything was working fine, but on ...
StanberyTrask's user avatar
1 vote
2 answers
407 views

Basically, my circuit contains only 1 resistor(like the basic LED circuit). I tried to know what is the actual voltage of digitalWrite(High). I don't understand why the value of analogRead does not ...
footycrazy's user avatar
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
0 votes
1 answer
123 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
0 answers
150 views

I have trouble with my laser sensor it doesn't work properly. When I connect all pins its doesn't work, when I remove GND and connect just the signal pin and VCC it works but the laser light is dim(I ...
Shushan Abovyan's user avatar
2 votes
1 answer
443 views

I connected a wave generator to the analog pins to read the frequencies of the waves generated. I used different frequencies of sine waves with a minimum of 0V and maximum of 5V. Whenever the voltage ...
Omar Ali's user avatar
  • 121
-2 votes
1 answer
160 views

Problem: I've made a circuit consisting of an 8x8 led matrix, which uses all of the digital pins on the Arduino UNO board, and I want to add an LED too it. I tried looking around the internet but so ...
Dheirya Tyagi's user avatar
0 votes
2 answers
2k views

I want to switch on/off some AC device using solid state Omron G3MB relay I know that for magnetic relay there should be transistor and flyback diode, but what about SSR? Can I connect it directly to ...
Antonio's user avatar
  • 111
1 vote
1 answer
2k views

On an ESP32 board I am trying this simple code to control the onboard led. But if I set it to HIGH, led is OFF, if I set it to LOW, led is ON (fully bright). What could cause this ? The board has one ...
adrianTNT's user avatar
  • 252
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
64 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
1k views

How too know whether digitalwrite(HIGH, pin_number) sets the voltage to 5 volts or 3.3 volts. I am yet to purchase arduino uno. I want digital pin voltage to be 5 volts. I am aware that thereis a pin ...
Hitesh Somani's user avatar
0 votes
1 answer
214 views

Firstly, excuse my poor English, this is not my native langage. I'm trying to use an Arduino Uno to drive an 8 relay board from an MQTT Subscription. I ask for help because i'm some kind of beginner ...
Pwol's user avatar
  • 1
1 vote
1 answer
285 views

so im new on arduino coding, and i made this code, where i input from serial monitor and then use it as a command for digital write. the problem is, sometimes the code work perfectly but then when i ...
Mochammad Farid's user avatar
1 vote
1 answer
235 views

I encountered to me inexplicable behavior on an arduino uno. I'm serial reading a string from the serial monitor/python serial. This string is the conditional on several if/else if statements. The ...
XIII_'s user avatar
  • 111
0 votes
1 answer
615 views

I was trying to find out how this library can run multiple stepper motors at the same time, and I saw this important function called... void AccelStepper::setOutputPins(uint8_t mask) { uint8_t ...
2012User's user avatar
  • 149
1 vote
1 answer
889 views

New user here. Using the examples provided on the Arduino IDE software I could produce melodies with a piezo buzzer, or have a blinking LED. Not anymore. No digital pin is giving anything. I can see ...
B7th's user avatar
  • 167
0 votes
1 answer
277 views

My friend and I are repurposing an old rc car for a project. When we connect the dc motors to 5V and ground, the motors spin. However, when we power the motors from 5v and ground it in the digital ...
Nicholas Carpenedo's user avatar
1 vote
0 answers
103 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
2 votes
1 answer
1k views

I am using a device with an ESP 8266 microcontroller. I have discovered that setting LED_BUILTIN to HIGH turns the built-in LED off and setting LED_BUILTIN to LOW turns the built-in LED on. This ...
dotancohen's user avatar
4 votes
4 answers
3k views

Consider the following: #define IN1 9 #define IN2 10 pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT); void LeftMotor(Direction direction) { digitalWrite(IN1, direction == Forward ? LOW : HIGH); ...
OrElse's user avatar
  • 57
1 vote
1 answer
2k views

I've seen people use code like PORTB |= 0x1 << 6 to set the sixth bit of PORTB in arduino. I understand that this is significantly faster than using digitalWrite. How can this be done using a ...
Jachdich's user avatar
  • 123
-1 votes
1 answer
550 views

In the (official) file wiring_shift.c I found the following code for shiftOut: void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val) { uint8_t i; for (i = 0; i < ...
Michel Keijzers'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
1k views

On an ATmega2560, can ports have some pins used for analog inputs but others as digtial i/o? Specifically, I only need to use 3-5 analog inputs but have many digital inputs. I would like to use the ...
Matthew's user avatar
  • 23
0 votes
1 answer
375 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
7k views

I am using a NodeMCU board and have already used 6 digital pins as output for interfacing with the LCD. I intend to use 2 more digital pins, one as input and other as output for interfacing an ...
maheshmt's user avatar
0 votes
0 answers
96 views

I'm using STM32(generic board) and I want to control bi-color LED(common anode). STM32 pin layout and scheme is below, so please see it. Now, in theory scheme Works, but in practice it Works halfway. ...
Pararera's user avatar
  • 213
3 votes
3 answers
8k views

I need to define a pin as output for relay module but when i do it in setup section, relay is activated (low - 0) automatically then i deactivated immediately with coding digitalWrite(pin, 1) but this ...
Alper's user avatar
  • 151
0 votes
2 answers
652 views

I have the following code with digitalWrite I aim to write with bitwise operation only. No portability concerns here whatsoever. (for atmega328p here) #define DATAOUT 11//MOSI byte commandbits = ...
Noel's user avatar
  • 163
1 vote
1 answer
367 views

I think I've scoured the SE for questions about PWM, and fast digitalWrite etc, but I didn't see this point addressed. I need to use direct writes to some digital pins. Some of the pins on the port ...
Jim Mack's user avatar
  • 269
0 votes
2 answers
5k views

I am wanting to send a digital signal from one Arduino to another. The goal is for one Arduino send a HIGH signal to a pin on the receiving Arduino. While the pin is HIGH, do function I initially ...
Edward's user avatar
  • 37
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
0 votes
1 answer
102 views

Will the Arduino IDE interpret digitalWrite(13,x), where x>0, as digitalWrite(13,HIGH)? And will it interpret digitalWrite(13,x), where x<=0, as digitalWrite(13,LOW)?
Kv07's user avatar
  • 25
1 vote
1 answer
1k views

I am making a triac-controlled light dimmer. To control the triac I want to use pins A4 or A5, because others are occupied. I have tried the following functions and methods, but nothing seems to put ...
flowian's user avatar
  • 53
1 vote
1 answer
5k views

I am trying to control this OWI Robotic Arm using the Arduino's digital outputs (I am using pins 12 & 13). If I wire up the wires to ground and 5V it goes one way, if I switch the wires, it goes ...
Graic's user avatar
  • 13
1 vote
2 answers
702 views

To save power consumption, I tried to connect the HC-06 bluetooth module to a digital pin of my Arduino Nano. (HC-06 +5V <=> pin 11, HC-06 gnd <=> gnd) In that way, I can toggle the bluetooth ...
doge99's user avatar
  • 111
5 votes
5 answers
2k views

So what exactly I am trying to do is control a motor and be able to turn it both ways without any extra parts. So if the hmp was on (the plus pole) and the hmm (the minus pole) acted like ground the ...
Moaz Tabosh's user avatar
0 votes
1 answer
170 views

I want to make 2 LEDs blink back and forth continuously, but they only do so once, and the second one is very dim. code: int ledone = 12; int ledtwo = 10; int keepgoing = 1; void setup() { pinMode(...
user avatar
2 votes
1 answer
6k views

Yesterday I played with a SRAM 621024 SRAM 1 Mbit IC and since I use a lot of pins, digitalReads and digitalWrites are needed including shift registers (see Example Since it took a long time for ...
Michel Keijzers's user avatar
-1 votes
1 answer
887 views

I can't figure out why the output voltage of analogWrite(255) is less than the voltage of digitalWrite(255). My code and an image of my setup are below. Some other useful information is that I am ...
user3242816's user avatar