35

TL;DR : When writing an Interrupt Service Routine (ISR): Keep it short Don't use delay () Don't do serial prints Make variables shared with the main code volatile Variables shared with main code may need to be protected by "critical sections" (see below) Don't try to turn interrupts off or on What are interrupts? Most processors have interrupts. ...


6

I have connected the Relay and IR receiver directly to the Arduino mini. Pin 10-14 are used for the relays Ins and PWD 3 for IR output. I hope you don't mean that you have connected the coils of the relays directly to the Arduino pins. If that's the case, the surprise won't be the regulator blowing up, but the MCU surviving. Please edit the post and add ...


4

There is a helper macro in avr-libc that is designed just for this purpose: #define pgm_read_float_near(address_short) __LPM_float((uint16_t)(address_short)) Read a float from the program space with a 16-bit (near) address. Note The address is a byte address. The address is in the program space. Use it like: PROGMEM float pi=3.141592653; // ...


4

You need to specify The order of range you are interested in - is it in the order of metres, tens of metres, kilometers or interstate ?:-) . ALL are possible with suitable compromise. How you intend to connect to the circuit - direct Arduino pins, high/low buffer, differential drivers, ... If you use 5V/0V "unipolar" then at say 9600 baud you can get many ...


2

As an alternative to Majenko's suggestion you can implement Virtual USB as described at Virtual USB Keyboard. You just need: 3 resistors 2 zener diodes a bit of wire a suitable USB socket The advantage is you haven't modified your Uno's USB chip (the ATMega16U2) so you can continue to upload sketches in the normal way. The disadvantage is that the ...


2

It sounds like you are going to be attempting software "bit-banged" USB. That, while possible, is severely frowned upon, especially when you have the resources to do it properly at your fingertips. In answer to your question, yes, you can use a USB mini B connector. It is no different to a USB B connector except it is much smaller and contains one extra ...


2

You have two problems here: How to take 24 readings on an Arduino with only 6 analog inputs. How to get the voltage in the range of 0 to 5 volts. To take 24 readings you can use an analog multiplexer or two. For example the 74HC4051 (8 channels) or the 74HC4067 (16 channels). With both of those you could handle 24 channels. To read the voltages you could ...


2

I realize that the OP asked about a single value, but I thought I'd add info on retrieving from an array. const float pmdata[] PROGMEM = {1.0, 2.0, 3.0}; then retrieve thusly: float val = pgm_read_float(&pmdata[idx]);


2

Judging by a datasheet (that I found on the web) that has a resistance of: 100 k to 200 k in the light 1 M in the dark Given that Vout = Vin * R2 / (R1 + R2) we can work out: Light: Vout = 5 * 200000 / (200000 + 5600) = 4.86 V Dark: Vout = 5 * 1000000 / (1000000 + 5600) = 4.97 V Do I have to use a greater resistor than 5.6k to achieve more ...


2

What have you selected as the analog reference? And if 'external', what is connected to the Vref pin? For the LDR resistances of 10K and 1K, you Vout should be ~ 1.8v at 10K, and ~ 4.2v at 1K, and giving A/D readings of somewhere around 370 counts and 860 counts, respectively, with a 5v analog reference. If your analog reference selected to the 1.1v ...


2

The serial monitor gives you a way to "talk" relatively directly with the Arduino – in this case it give you a way to easily confirm that the basic circuit is working and that you are getting sensible temperatures. That's a foundation on which you can build. It is unlikely – I think – that the serial monitor is causing the problem. But before you believe me,...


2

From what I could find, it seems theres a command for pinging a server. It returns the number of milliseconds taken for the server to respond. The command is: AT+PING="web site" or AT+PING=<ip addr>, from 2 separate sources. You'll have to test them to see which (if not both) is correct.


2

I have had good results using the Bluefruit LE UART Friend module from Adafruit with a 32u4 micro Arduino type module, there are only a few pins to connect up to get things going (do remember to follow the instructions to pull the CTS pin to ground). As per the previous answer it really does depend on what you want to do with it - but this module does Low ...


2

This answer does not answer your question, but it implements the device you are describing. Unfortunately I don't have enough reputation to comment, so I will post it as an answer. As people said before, ping is not a reliable option to scan the network. On Linux you can use dedicated (software) tools to scan the network, but even they struggle to reliably ...


2

Things have changed in the three years since you last used your FTDI board. Most importantly avrdude has changed. You will most likely find that you can program your boards perfectly fine using Arduino IDE 1.0.1. What has changed is that avrdude has been modified to counter a change in the FTDI drivers. It used to be that the FTDI drivers would pulse the ...


2

The Arduino website says you should not power your Arduino Mini with more than 9 volts. Warning: Don't power the Arduino mini with more than 9 volts, or plug the power in backwards: you'll probably kill it. https://www.arduino.cc/en/Main/arduinoBoardMini The 5 to 12 Volts (not more than 12V for long time periods) refers to the Arduino UNO and ...


2

I'm currently using inexpensive Arduino Nano boards running GRBL for a couple of little CNC machines. The version I have uses an ATmega328 running at 5V and they work very well. They may be available with 3.3V regulator instead of 5V - I don't know and I preferred to have 5V anyway. The nano boards that I have look to be a complete Arduino: one side of ...


2

Use two for loops to send the multidimensional array, and two for loops to receive the multidimensional array. Sending: int a[3][4] = { {0, 1, 2, 3} , {4, 5, 6, 7} , {8, 9, 10, 11} }; for (int x = 0; x < 3; x++) { for (int y = 0; y < 4; y++) { Serial.print(a[x][y]); } } Receiving for (int x = 0; x < 3; x++) { for (...


1

Try to reset manually just after compiling end


1

Ok strange, just after posting this the qduino decided to flash a different light on me so I try to upload again and it works... So apperantly just by keeping the qduino connected for some time it will start to work again...


1

ModemConfig * config is a pointer to a ModemConfig struct. You need to create a ModemConfig struct, populate it then pass a pointer to it in the call to the setModemConfig() function. Something like this: // create the struct ModemConfig mc = ModemConfig(); ... //populate the struct values // then call the function setModemConfig(&mc); The datarate ...


1

Make the Bluetooth message send how many seconds it is until the light should be on, and how many seconds it should stay on. Then the arduino code can just handle everything with millis(). You know the millis() you were asked to start, add the delay, and wait for that time. Delays less than 50 days (wrap around of millis ()) take no effort to handle it ...


1

A simple bluetooth module like a HC-05 wired to your Arduino will give you a serial stream that can be read and/or written. With the RX/TX connected to say pins 10 & 11, a SoftwareSerial() object will provide access: #include <SoftwareSerial.h> SoftwareSerial mySerial(10, 11); // RX, TX void setup() { mySerial.begin(9600); } void loop()...


1

First of all you should connect the DTR (not the DSR) pin to the reset terminal WITH a 100nF capacitor. See this page or the arduino uno schematics to see how to put the capacitor (it's simply in series with the signal. However I suggest you to start programming WITHOUT the autoreset; once you are sure that you can program it then try soldering that ...


1

Not all devices (including) phones respond to ICMP Ping. This may differ for each (mobile) OS and version and phone make and model. But assuming your phone does respond to ping... If you use the ESP with just the default firmware (a waste of a perfectly capable microcontroller), then indeed use the AT+PING command from the other answers. If you use the ESP ...


1

Do you require slaves or masters? Both modules are actually the same, it is just the firmware that is different, and in turn that changes how they use the pins. HC05 can be both Master and Slave, and has a full set of AT commands, whereas HC06 can only be a slave, and has a more limited set of AT commands at its disposal. Otherwise, for low power ...


1

Just found this on Digi website. "The XBee is a 3.3V only device, connecting 5V to any pin may damage the radio. If you had connected the XBee to a 5V microcontroller or power source, it's possible that the radio is damaged beyond repair". On this link, the last topic, knowledge.digi.com/articles/Knowledge_Base_Article/…. I really think that the XBee is gone....


1

As established in the comments, the issues here are powering the module directly from a GPIO pin, which are limited to 20 mA, and potentially the limited current of a 9V battery. Personally I avoid using 9V batteries in projects, as they are comparatively expensive for the lifetime they provide. There are various boost/step-up converters that make a steady ...


Only top voted, non community-wiki answers of a minimum length are eligible