Questions tagged [digital]

Digital refers to signals which are either on or off (high or low, one or zero). This contrasts with analog signals which have a range of values.

Filter by
Sorted by
Tagged with
0
votes
2answers
166 views

Plug in analog sensor into digital pin

If I take an Arduino (samd21, if it matters) and plug in an analog sensor/pot into a digital pin and then set that pin to be an input, would digitalRead(#) trigger HIGH and LOW at some threshold point?...
2
votes
1answer
65 views

So many missed bytes with serial comm

I have a setup with serial comm from Raspberry Pi to Arduino. It's communicating at baud 9600 on both devices, and from Raspberry Pi 3b+ GPIO-14,UART0,TX0 to Arduino Nano RX0. There's a level shifter ...
1
vote
1answer
52 views

How to test custom cables?

I'm trying to make a cable checker to help me make custom cables for my computer. I'm thinking I plug the cable ends into sockets on the device, then the Arduino checks between different pins to make ...
2
votes
1answer
97 views

digitalRead() function of Arduino doesn't read Input value sent by sensor after detecting the object

I'm trying to turn ON the LED(inbuilt/PIN13) when photoelectric proximity sensor(12v) senses any object. Sensor is connected on pin 2. Assigned pin 2 as INPUT, I've got a 12v spdt relay for switching. ...
0
votes
1answer
39 views

Does setting a value always mean setting a Arduino pin?

One thing that always confused me was why we use int or other commands to set the variables to have pin numbers as if those commands were always restricted to pin numbers only. For example int ledPin =...
0
votes
2answers
71 views

Turn on relay for amount of time by continuous input

I have a project having two input status first the input is not continuous the output buzzer relay will be on for 10 seconds and then turned off or it can be off directly by push button the second ...
1
vote
1answer
311 views

SoftWire Library Programming Questions for I2C with Digital Pins

I am trying to use 3 TOF10120 Laser Sensors with one Arduino that all have the same, fixed I2C Address. I don't believe it is possible to change the I2C address of the TOF10120, but if I am wrong, ...
4
votes
0answers
96 views

What’s the most stable digital communication protocol for sewable electronics? [closed]

I’ve spent the past few days trying researching communication protocols and I have a few issues. With sewable electronics, you need to work with cables with a fairly high resistance that are ...
2
votes
2answers
515 views

Unable to use analog pins as digital inputs

I want to use the analog pin A7 as a digital input pin. As stated in the Arduino docs the analog pins can be configured in the same way like any other digital pin. However, when trying to configure an ...
0
votes
2answers
293 views

How can I add a potentiometer and more buttons to my custom game controller?

I'm new to using Arduino, and know next to nothing about programming. I'm currently trying to add a potentiometer, and possibly a few more button inputs to my 3D-printed guitar controller project It ...
2
votes
2answers
127 views

Detecting an incoming 7.875 kHz pulse to use as trigger

I have written a code that detects an incoming pulse (square) of 7.875 kHz to trigger the output High for the entire duration of pulse, and trigger the output low if the pulse is off or not detected. ...
1
vote
1answer
174 views

Nano: All digital pins do not output anything

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 ...
1
vote
1answer
84 views

Is it possible to overload the digital pins for an Arduino?

I worked on an Arduino project for school that was a self-driving security robot that also acted as a smart home system. It was essentially a self-driving Roomba-like car that included several LED's(...
1
vote
1answer
36 views

Confused as to how 2 of my interrupts are firing from just 1 pin input?

I have the following code which uses interrupts to set a flag for whether serial IO should happen to update my PC about a particular pin input. So I have interrupts on pins 2 and 3. I am using the ...
0
votes
2answers
105 views

Is my Arduino skipping a statement?

So, I made this code (I'm rather new to this). The only thing that the Arduino should do, is when I press the button on pin 2, turn on the LED on pin 4 and emulate CTRL + R on the keyboard for the ...
1
vote
1answer
2k views

DHT11 analog or digital?

I saw some projects with DHT11, some connect it with analog pin, others connect with digital pin. Is there any difference / advantage connecting to the analog?
-1
votes
1answer
62 views

Dynamically control the output voltage of a 60V DC input

I am hoping to control a 60V DC input source dynamically using my Arduino so that the output voltage could vary between 0v to 60v. At first i was looking into digital potential meter, however I couldn'...
0
votes
2answers
59 views

Read amount of I/Os in code

I want to write an Arduino code, that runs on several different Boards. The code can perform digitalRead/Write operations, but the pin number will be set from the user/outside. I want to include a ...
0
votes
2answers
139 views

Is it possible to use the Arduino Due's specials pins for digital writing and reading?

Hello the arduino documentation on the due specifies the pin mapping of the pins.I am making a custom board using the dues schematics and i am running still a bit low on pins. Also some of the special ...
1
vote
1answer
113 views

How can I read this digital pin for Nano by using AVR's Atmel Studo?

How can I read digital pin 6 in AVR? I set the pin as input as follows: DDRD = B0100000; //this will set pin 6 as input But how can I now digital read this pin?: Another way of putting it: how can ...
3
votes
2answers
437 views

How to count positive electrical pulses?

I have a device that has one blinking LED. I want to count the number of blinks. I planned to do it using Arduino. I will connect two terminals of LED input to Arduino digital input pins, and I will ...
1
vote
1answer
119 views

Help combining digital and analog code in arduino programming

So I'm making a device that does 3 things, Measures frequency of an audio signal through a microphone Checks whether there is a weight placed on a pressure pad (my pressure sensor works through the ...
3
votes
1answer
220 views

Red LED not turning off on Adafruit Circuit Playground Classic

When using the traditional Blink example program, the light blinks as expected. Even when writing from scratch digitalWriteing pin 13 to high and low repeatedly works fine. The problem is when I try ...
2
votes
1answer
52 views

`LOW` being defined as `0` and `HIGH` being defined as `1` - is this a part of external specification?

Arduino.h defines LOW as 0x0 and HIGH as 0x1. Does the Arduino API intend to expose that fact? Does it guarantee that this will always be that way? In other words, what is the intended purpose of ...
0
votes
1answer
511 views

How can I scan for a HIGH signal on digitalRead during the main loop, while running other things?

I'm working on a program which listens for certain bytes on serial through an if/then/elseif ladder. I want to also check if a pin (say, A15) has been given a HIGH state, by another Arduino with ...
1
vote
0answers
133 views

Cannot write pin LOW

All the other examples I've seen have had coding errors where they set a pin LOW in a loop with no delay so that it goes high again right away - but this problem is different, and probably something ...
0
votes
1answer
859 views

Using a water sensor with a NodeMCU make it less sensitive?

I'm trying to digitalRead from a water sensor (the one in the picture) using NodeMCU v3,when I try the sensor with an Arduino board it works fine, but when I try it with an ESP8266 NodeMCU v3 it ...
0
votes
1answer
57 views

Can I read using an analog pin on an arduino Mega whether or not there is a high (5v) voltage on a wire from another board's digital pin?

I am making a peer-to-peer network of initiating devices and a common hub, which controls most of the hardware. It sends a number over Serial to Mega's Serial1 (Mega's Serial is used for communicating ...
3
votes
1answer
961 views

Digital I/O threshold voltages for ATmega32u4

What are the voltages on a ATmega32u4 (eg Arduino Leonardo) such that a HIGH or LOW is read? I want to ensure that I'm reading the chip reference manual correctly, where Table 29-1 says: VIL: Input ...
0
votes
1answer
59 views

Is my code triggering the N-Channel MOSFET as I have intended to

I have a certain bit of code that I believe after 10 seconds will send a high signal to the second digital pin for 50 seconds. After it will not do anything. For some reason the nichrome wire is not ...
1
vote
2answers
1k views

Analog vs Digital Accelerometers - pro's and con's? [closed]

For my project i need to measure accelerations up to 16g. My options are either digital accelerometers such as the MPU6050 or MPU9250 or an analog accelerometer such as the ADXL326. What are any ...
-1
votes
1answer
88 views

How can we use two devices at the same time with arduino?

I am using fingerprint module r307 and LCD together. In that, I am using 2,3 digital pins of arduino for data transfer to the fingerprint.(I tried other pin configurations for this but it didn't work) ...
1
vote
1answer
43 views

Elapsedtime variable not resetting

I am new to Arduino programming. Let me describe the application I am working on. I am pressing a button for a certain period of time (30 sec). I can not hold it in a pressed position for all the time....
0
votes
1answer
198 views

Routing Matrix with a large number of I/O [closed]

Lets say that i would like to make a 128x128 routing matrix with an arduino uno, Since i am unexperienced i think of using two 4051’s for 8x8 patching and because i want to persist the patch, ...
1
vote
1answer
202 views

Arduino UNO LED half brightness when connected to digital GND but not analog [closed]

I am using an Arduino UNO. When lighting an LED with the switch button on a joystick module, I have two situations: If the LED's cathode is connected to GND on the digital pin side of the Uno, the ...
0
votes
2answers
3k views

Sending a digital signal from one Arduino to another to trigger an event

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 ...
0
votes
1answer
5k views

Read frequency of input in digital pins

This is a somewhat theoretical question: Let's say I have some sensor that sends digital signals to one of Arduino's digital ports. Now, I don't know the frequency it sends those signals in. For ...
1
vote
3answers
68 views

For Arduino, is there a meaningful difference between carriage returns?

Serial.write(0x0d); // hex Serial.write(13); // ASCII Serial.write('\r'); // char Is one more efficient? I read how it depends on the terminal program. So does that mean the IDE? (This is my ...
1
vote
2answers
727 views

Digital Sound sensor

I am having trouble with my digital sound sensor. My goal: Clap 2 times and a led goes on. So I wrote this code. I don't know if it is correct or not. This happens: If I clap, from the serial monitor ...
-1
votes
1answer
59 views

Error in finding frequency of an input signal

Here is my code to find the frequency of an input rectangular wave at pin 8 of the Arduino Uno board. const uint16_t freqPin = PB0; const uint16_t load = 0; unsigned long int count=0; unsigned int ...
0
votes
1answer
41 views

Digital selection for gain control not working instead showing 0

I am making a device which will have a button to measure the input and another button to reset and the inputs are variable analog values(0 to 5v) and output is a ratio of two analog input voltages. It ...
0
votes
1answer
163 views

How to digital read and send the data through serial to PC with speed around 2 MHz?

I would like to read analog data with frequency sampling around 2 MHz and send it to PC to be processed with python for digital oscilloscope. I use Arduino Nano. I have found ADC (AD9057, PDF) that ...
2
votes
2answers
984 views

Digital Band pass filter arduino 1100-1300 Hz

For a project I need to design an digital band pass filter. I started of with this in Matlab: wch=1100*2*pi; wcl=1300*2*pi; sys=tf([1/wch 0],[1/(wch*wcl) 1/wch+1/wcl 1]) sysd=c2d(sys,9615,'tustin') ...
1
vote
2answers
55 views

Upcoming Project [duplicate]

Hey guys I have a project that will require 20 I/O pins with serial communication from a computer to control each of the pins. I would like something as small as possible would a arduino micro or uno ...
1
vote
1answer
1k views

4x4 matrix keypad - Multiple inputs cause extra readings

I have the following matrix keypad - I am using this as a sort of controller with my Arduino (Mega2560) but I can't get real multiple inputs to work. I am able to have say two individual keys ...
0
votes
2answers
94 views

Where can I find the complete list of Arduino Serial Command & Query Strings?

I am planning to use the Arduino as a replacement for a USB-Controlled Digital I/O device, which will be integrated into an existing C++ software package that I created. I understand that the Arduino ...
5
votes
3answers
936 views

Fool Proofing My Arduino IC Checker [closed]

I am creating an IC checker for some high school juniors since a faulty IC can be a nuisance of a bug to find when bread-boarding. These ICs are all simple TTL gating from the 74LS series; the set I ...
1
vote
1answer
61 views

Light Powered Motor Troubles [closed]

I'm working on a small car (<1 kg) which will drive when there is light and stop when there isn't. Below is a plan with code drawn up (the only numbers I know for sure are the current gains for the ...
2
votes
1answer
248 views

Consequences of dynamically changing input/output configurations of digital pin?

I am creating an IC checker for a large chunk of the 74ls series (basic TTL logic chips), which means that I have 14 pins running to the IC to verify its functionality. One pin is power (+5V) and ...
1
vote
3answers
2k views

digitalRead keeps giving 1

I am new to arduino programming and I have bought arduino UNO a few days ago. I am trying to read the value of pin 4 using digitalRead with pinMode INPUT_PULLUP but it keeps giving me 1 even when the ...