Most Popular

1500 questions
4
votes
1 answer

Built-in capacitive touch detection with SAMD21 development board (Arduino Zero Compatible)

I bought this SAMD21 development board which shows up as an "Arduino/Genuino Zero (Native USB Port)" when plugged in. And I've successfully got a blink sketch running on it all good so far: The reason I picked up this board was to experiment with…
juliusbangert
  • 161
  • 4
  • 12
4
votes
1 answer

'tmElements_t' does not name a type

I've connected a real time clock ZS-042 to my Arduino Uno. I tried to set the time, using an example from DS1307RTC library. Here is my code: #include #include #include *const* char *monthName[12] = { "Jan", "Feb",…
Anton Sachko
  • 43
  • 1
  • 1
  • 4
4
votes
3 answers

Connecting ESP8266 to Arduino Uno

I want to get data from ESP to my Arduino. I added firmware v2 to my ESP and it works correctly in my serial USB to TTL and shows the JSON data that I send to it. But when I connect to my Uno serial it shows some unknown chars. #include…
aliyousefian
  • 181
  • 4
4
votes
2 answers

How can I work with two devices that use the SPI protocol?

I'm working with a project in which I need to use an SD card module and an RFID antenna simultaneously. The devices that I'm using are the MFRC522 and the CATALEX SD Card Adapter. Both have SPI Protocol, and they're using the libraries MFRC522.h and…
Pinedo98
  • 43
  • 2
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