Most Popular

1500 questions
4
votes
4 answers

Using millis() to toggle an LED every 500 milliseconds

I thought the code below would toggle an LED every 500 milliseconds. But it does not work. I'm not able to catch the mistake, which must be very silly. void setup() { pinMode(3, OUTPUT); } void loop() { unsigned long cnt=millis(); if(!(cnt %…
Rajesh
  • 171
  • 2
  • 7
4
votes
1 answer

Is there GUI to flash a sketch with new variables?

I'm dabbling in a project and would like to add a feature, but I need some help from the community. My project returns a response from the wunderground api and lights an led based on the temperature in the response. I plan to enclose the circuits…
KidaStl
  • 41
  • 2
4
votes
1 answer

Purpose of USB (FTDI) and ICSP connectors

As an Arduino newbie I am a little bit confused about possible ways of programming and communicating with this device. I have done some research and it seems that: ICSP is used for programming with a bootloader in MCU. The USB (FTDI) port is used…
azrael
4
votes
3 answers

Detecting if a push button was pressed and released

I want to detect if a push button was pressed and released again. So I thought the right approach would be to first wait while the pin yields LOW and then wait while the pin yields HIGH: void push(int pin) { // wait until button was pushed…
Patrick Bucher
  • 143
  • 1
  • 1
  • 5
4
votes
1 answer

Arduino uno PWM CTC mode - strange behaviour on interrupt

i have this simple code that i use for generating a square wave signal of 125 KHz on pin 9 using Timer1 in the "Clear Timer on Compare Match (CTC) Mode". I also use Timer1 Compare Match A interrupt for toggling pin 7 of PORTD. void setup()…
Anacleto
  • 43
  • 3
4
votes
3 answers

Rotary encoder on Uno and interrupts issue

This question is regarding a project using an Arduino Uno. I have one of these quadrature rotary encoders. I'm using a slightly modified version of the code from the article, Quadrature Encoder too Fast for Arduino (with Solution), which uses a…
pat333
  • 41
  • 3
4
votes
1 answer

Using signal strength feature of nRF24L01 module

This is a walkie-talkie project and this circuit really worked, voice can be transmitted from one nRF module to another nRF. Additionally, I want to observe how well the signal strength is, by lighting up an LED. They talked about a test.RPD…
user175079
  • 41
  • 1
  • 3
4
votes
2 answers

Sending serial data in an interrupt

An ATMEGA328-P chip is used with a toggle switch attached to pin 8 and a momentary switch attached to pin 9. My objective is to send the following information over serial: The status of pin 8, every second. Count the number of presses of pin 9,…
Greg
  • 143
  • 1
  • 1
  • 5
4
votes
3 answers

Controlling EL wire or panels with arduino

I understand that el wire and paper needs a special power source known as an inverter to light it up. If I wanted to control it from an arduino, what point would I connect the arduino to the light or inverter?
Tom
  • 165
  • 1
  • 5
4
votes
3 answers

can arduino on output mode sink current?

I have a arduino set below: pinMode(1,OUTPUT); digitalWrite(1,LOW); Now, I am expecting 1.2mA current flow through the pin that is set as output. Is that accepted? If so, what it the max current a pin can sink? The current comes from a pul up…
Ryan B.
  • 103
  • 1
  • 6
4
votes
1 answer

How can configuration values be stored on an ESP8266?

I have a project that uses an MQTT service, and I'm wondering how to best store the configuration settings (server, user, password, port) for the service as right now they are just hard-coded into some constants. I saw that EEPROM can be used for…
travis
  • 201
  • 1
  • 2
  • 8
4
votes
1 answer

Is it possible to sample sound with arduino?

I have the arduino duemilanove with atMega328. The frequency is 16Mhz. I want to sample and record from the audio jack. I searched and i found if i want to record "everything - so to speak", i have to sample at 44100Hz. That means this is unfeasible…
user1584421
  • 1,425
  • 3
  • 26
  • 36
4
votes
3 answers

Confused between SPI and I2C for SSD1306 OLED

I recently got myself an SSD1306 OLED display: I haven't been able to successfully wire it to an Arduino (Mega 2560) however. I have been reading up on I2C and SPI and checked some libraries from Adafruit and U8G2. However, I'm confused, since most…
Bart Van Loon
  • 145
  • 1
  • 1
  • 6
4
votes
1 answer

How does the microcontroller know which clock to use?

I had seen some tutorials on how to assemble an Arduino on a breadboard. They all just place the external crystal oscillator according to the circuit and then, just burn the bootloader and it starts working. According to my little knowledge the fuse…
Aneesh Sharma
4
votes
1 answer

Arduino continuously reading ADC value using interrupt

I have a mono jack audio act as analog input for arduino UNO. The microphone outputs voltage that varies in terms of amplitude (volume) and frequency. In order to get the high sampling rate, I use prescaler 16 and set high baudrate for serial…
SNahar
  • 43
  • 1
  • 1
  • 4