Most Popular

1500 questions
4
votes
3 answers

Arduino port relocation (PORTD to PORTB)

So I'm trying to connect the chip with an 8-bit data bus. All works good, but... Arduino Uno uses D0 and D1 for serial TX/RX (USB connection with PC). When I try to open a serial connection (on serial.begin stage) ports D0 and D1 blocks and the chip…
Thane Krios
4
votes
2 answers

OLED display crashes when connecting USB

I got an 16x2 OLED Display (DEP 16201-Y , compatible to the HD44780 controller) for my Arduino Uno and I got it to work in 4-bit Mode, but just if the USB isn't connected and it is powered by a 9V power supply. So my routine is: Connect USB and…
Niklas
  • 183
  • 4
4
votes
1 answer

How do I prevent Arduino from running on startup?

I just uploaded a sketch to my Arduino Leonardo, which presses a key on the keyboard. The code was unfortunately bugged and now as soon as the Arduino is powered on, the key is being pressed. When I try to upload a new sketch that fixes the issue, I…
user36797
4
votes
1 answer

Arduino Leonardo(Atmega32u4) - Detecting if USB is connected to a computer?

The closest thing I can find is if(Serial) but that only returns true if there's a serial port open. The function I want, ideally, should: Return true if plugged into a computer Return false if plugged into a USB power bank Return false if not…
Stephen
  • 43
  • 3
4
votes
4 answers

Is it possible to run two for loops separated?

I have three funtion which describe the brightness of three LEDs. I want the seconde loop run 1 second after the first one and the third 1 second after the second one. One loop needs approximately 5 seconds. So basically I need to run three loops…
gamma
  • 161
  • 3
4
votes
2 answers

MAX7219 powered on via digital pin set to HIGH is not working good (I < 25mA)

I'm using 7-segment 8-digits MAX7219 eBuy module in my battery-supplied ATMega168P project to output some readings. MAX7219 in powerdown mode draws ~150uA (as stated in the datasheet) which is too much for me, because the rest of the circuit draws…
finnan
  • 302
  • 1
  • 2
  • 8
4
votes
1 answer

How to implement setSyncProvider and verify it is working with PC

I'm trying to retrieve / synchronize time from PC using this Time lib function: setSyncProvider( requestSync); //set function to call when sync required It sends ASCII BEL (07) character to PC, but I'm getting no response using Serial.available.…
Vaclav
  • 89
  • 2
  • 4
4
votes
2 answers

Distance and Serial or SPI

I'm setting up a grid of 200+ slave modules which will be about 12 inches apart and the master will be anywhere from 5 to 10 meters away from the closest module. Each slave module will have a ATtiny85 to manage the sensor reading, LEDs and the…
Jeremy Gillick
  • 481
  • 1
  • 3
  • 8
4
votes
2 answers

Interfacing Logitech Joystick to Arduino and interrupt a while loop

I am working on a project of a robot arm. The joints are made of servo motor. The basic function can be describe as: The robot arm (the servos) were moved manually by the Logitech joystick. The user could press a certain button to remember a…
John Keane
  • 41
  • 1
4
votes
4 answers

Use timer0 without affecting millis() and micros()

I'm writing a library which needs an ISR to turn off an LED some time after it was turned on. Since it's all about turning an LED on and off it doesn't need to be very precise. On the other hand I would like to use this library in a program where…
noearchimede
  • 482
  • 2
  • 7
  • 19
4
votes
1 answer

Code to use an Arduino Mega 2560 to transfer UART <-> USB to debug an other Microcontroller

I have the following circuit and want to use the Arduino Mega 2560 as an debugger for an other Microcontroller. So I am looking for the code to redirect the UART input from "P17 (RX2)" to the serial USB and the data coming from the serial USB to…
kimliv
  • 561
  • 1
  • 4
  • 17
4
votes
3 answers

Multiple Buttons on Single Analog Pin and Trigger Pin Arduino Uno

I've researched how to attach multiple buttons to a single analog input using a resistor network. Instructables has a good lesson on this: http://www.instructables.com/id/How-to-access-5-buttons-through-1-Arduino-input/?ALLSTEPS My requirement is…
hagope
  • 161
  • 1
  • 5
4
votes
4 answers

Arduino Uno 3: Stuck at 'uploading...' sketches

I was playing around with my Arduino Uno R3 board with Sublime Text 2 & 'Stino' as IDE I am not sure if it is my code is the problem or if I broke something... I pressed upload while another sketch didn't finish uploading, even the original Arduino…
robertgzr
  • 43
  • 1
  • 1
  • 4
4
votes
1 answer

Is it possible to extend the reach of a PN532 NFC/RFID shield?

I am working off an Arduino Uno with an AdaFruit PN532 NFC/RFID shield. The goal is to have a shoe box, with a false bottom. Under that false bottom would be my prototype, which I hope will be able to detect any MIFARE tag that is in the box, above…
erik
  • 181
  • 4
4
votes
1 answer

Maximum Delay time

I am designing a driver for a Bipolar stepper motor using Arduino Mega 2560 and DRV8825 Stepper driver. In my application, a stepper motor (Nema 24) will run for 5 minutes and stop for 2 minutes. I have doubts about is what is the maximum time an…
CNA
  • 141
  • 1
  • 4