24

There three ways to accomplish this. (last is my favorite) 1) Jumper an unused IO to the RESET pin. Leave it as INPUT for normal run, As it is externally pulled high. And when desired to reset set it as LOW and Output. (bang its rebooting). setup() { ... pinMode(PINtoRESET, INPUT); // Just to be clear, as default is INPUT. Not really needed. ...


10

You can extern "C" #include like the following: extern "C"{ #include "crc16.h" }; void setup(){ } void loop(){ CalculateCRC16("<09M", 4); } And the crc16.h file could be (some minor fixes, the #pragma once, a cast): #pragma once #include <stdio.h> #include <stdint.h> uint16_t crctable[2] ={ 0x0000, 0x1189}; uint16_t CalculateCRC16( //...


10

@Michel Keijzers provided overall answer. And now probable cause: char * GetEmptyLine(int width) { char * line = new char[width + 1]; In the Menu.cpp. There is no single delete in the code at all. But so many calls of GetEmptyLine. Using the Arduino String might have done less evil than this kind of memory leak.


8

In theory, any compiler which outputs AVR assembly could be used (modulo limitations on code size, ram usage etc). AVR backends exist for both LLVM and GCC -- so in theory, with some effort, most languages which are supported by LLVM and GCC's front-ends could be compiled to AVR. A big question will be library support, etc. Never the less, here's a ...


8

The datasheets for the AVR microcontrollers are reasonably good to read. Just Google for the exact controller on your Arduino (eg. ATmege328) and find the "Complete" datasheet on the atmel.com website. Don't download the "Summary", it doesn't include a lot of information. Download the datasheet from atmel.com, that is the only location with the most recent ...


8

The underlying random() function isn't part of the Arduino code. It's actually part of avr-libc. The Arduino IDE only comes with pre-compiled object code for it (as far as I know). It's open source though. You can get information about it here: http://www.nongnu.org/avr-libc If you look down the page a short way, you'll find the "Source code and ...


7

The concat function does not implement a float version, but some of char, int, unsigneds... unsigned char String::concat(long unsigned int) unsigned char String::concat(unsigned int) unsigned char String::concat(int) ... so the compiler does not know how to cast (truncating probably the float) to integer, as there are several options. You have to convert ...


7

I wouldn't assume by default that it's a hardware problem. It seems like a software problem, and there can be many reasons that the Arduino hangs, e.g.: Too little stack space Too little heap space Pointer problems The Arduino does not have safety against too little memory, that means it will overwrite memory -- causing lots of problems -- and hanging is ...


5

Your CRC function can easily be converted to C++ so that it can go into a *.cpp file. All you need to do is use an explicit cast when you initialise your c pointer. Here's the 'proper' C++ way to do it: const uint8_t *c = static_cast<const uint8_t*>(c_ptr); However, an old C-style cast would also work: const uint8_t *c = (const uint8_t*)c_ptr; The ...


5

GND => GND 5V => 5V Digital Pin 2 => 232RXD Digital Pin 3 => 232TXD A better choice of board would be the Leonardo, since you could connect such a shield and use the USB port right out of the box. However, since you have the Uno, there is a solution. From Arduino: The SoftwareSerial library has been developed to allow serial communication on other ...


5

Some commonly known ones: Ada Basic Forth, alt, alt Java Pascal Python C (mac) and C (Windows) In theory you should be able to extend avr-gcc to support other languages, though this is no small undertaking. I should also caveat that support for languages other than C typically comes with some fairly weighty restrictions on language components -- for ...


5

This application already exists. It's called AVRDUDE: http://www.nongnu.org/avrdude/ You can download it compiled for Windows at the link above. This is the very flashing tool that the Arduino IDE uses for the AVR boards such as Nano. You can get the AVRDUDE command the Arduino IDE uses to upload to the Nano by following these steps: Start the Arduino IDE ...


5

As explained in Michel Keijzers' answer, you cannot use the = operator to assign something to a string (a character array). However, you can initialize a string using =. There is an important distinction between assignment, which you can do anywhere in a program, an initialization, which can only be done at the time you define a variable. For example: int ...


4

You would either have to replace the bootloader on your chip (software) with one that knows about your GPRS shield (I don't know if there is one, so you would most likely have to write your own and that is not a trivial task), or use a second microcontroller to act as a programming interface between the GPRS shield and the main Arduino. That could be ...


3

SoftwareSerial cannot talk to itself. Since it is implemented in software and not hardware it can either send or receive at one time, but not both. Look at the code for write in SoftwareSerial: size_t SoftwareSerial::write(uint8_t b) { ... cli(); // turn off interrupts for a clean txmit ... // Write each of the 8 bits for (uint8_t i = 8; i > ...


3

In case you have the original Arduino bootloader which you want to execute as a part of the reset, you can do a SW reset by jumping to the bootloader reset address (0x7800 on ATmega328p boards) void reset() { asm volatile ("jmp 0x7800"); } The watchdog reset approach will not work because of a bug in the bootloader. Here's a note from ATmega328P ...


3

The "best" software for me is the free Visual Studio Express for Desktops. Using C#, I would add a SerialPort component to the form, configure it for the same COM port as the Arduino/FTDI, then send commands to it. Visual Studio is "stupid simple" (I'm not implying anything :D). Double-click Button in the toolbox(1) and it creates one. Double click the ...


3

I finally solved my problem by buying an Arduino Due! It was a problem of speed, not of code. The Uno is just not powerfull enough to read an write to Software Serial at 115200 Bauds, or even 9600, which I tried. The Due has absolutly no problem. I made a small code test to intercept "words" coming form "USB" To "GRBL", and it works just as expected, while ...


3

Is it possible to print the debug statements in the Serial window while the GPS module is connected to the hardware serial ports? Yes, that works. If you connect the Arduino TX pin 1 to the GPS RX, then everything you print to Serial goes to both the Serial Monitor window and the GPS device. This works, because: It's ok if you see the GPS configuration ...


3

The main problem seems to be, that you are not adhering to the MCP's communication protocol. You just try to directly and only send the pure analog measurement to it. Look at this image from page 18 of the MCP4725's datasheet: It describes the operation is Fast Mode, which seems to be the correct mode for this. (Similar descriptions for the other modes can ...


3

Not really a physics question, but I will answer anyway. loop() is the standard Arduino function which contains code that the microprocessor runs repeatedly (as opposed to code in setup() which is only run once). light = analogRead(5); takes an analogue voltage reading from pin 5, encodes it as an integer value (either 10 or 12 bits depending on the ...


2

There are also some people working on Javascript node.js based systems. One that is already publicly available is Espruino and another is Tessel which launches in spring 2014.


2

Almost impossible to answer really. Questions with "best" are always going to yield opinions which probably won't apply to your situation. For example, I would do a C# desktop application because that's what I do, and nothing in that environment hinders communication with an Arduino. So, what's best for me is best because of "familiar and will work" and we ...


2

Almost everyone uses either AVRDUDE (directly or indirectly, e.g. via the Arduino IDE) or the upload capability in Atmel Studio. I cannot speak for AS, but AVRDUDE does require options to tell it which programmer and device to use. WinAVR includes AVRDUDE, but is not strictly required as Win32 downloads are available at the AVRDUDE site.


2

SoftwareSerial cannot transmit and receive at the same time. So even if you connected pin 8 to 9 with a wire, your sketch will not receive what was transmitted. That's a guess without your wiring diagram. NeoSWSerial can simultaneously transmit and receive. It is a drop-in replacement for SoftwareSerial. However, AltSoftSerial is even better, and it ...


2

A regular Arduino uses an AVR, more "pimped" Arduino might go to ARM. Some special versions of Arduinos uses other chips, such as the ever iconic ESP8266. For home automation, an ESP8266 is WAY enough. Using an ARM is quite and overkill for home automation. But I've never seen anybody using a full PC for it. Why? Because it is around 10-20 times more ...


2

The simplest and crudest method: int val1 = analogRead(A0); delay(5); int val2 = analogRead(A0); if (val2 > val1) { // It went up (for example). }


2

Assuming everything is hooked up correctly, your issue is likely related to electromagnetic noise (aka electromagnetic interference, EMI). Load cells output very small voltages, which is why you need the HX711 amplifier. Your long wires are essentially acting as antennas, picking up the electromagnetic noise in the room. One easy way to reduce the noise is ...


2

printf_P(PSTR("OBSERVE_TX=%02x: PLOS_CNT=%x ARC_CNT=%x\r\n")); This should be printf_P(PSTR("OBSERVE_TX=%02x: PLOS_CNT=%x ARC_CNT=%x\r\n"), OBSERVE_TX, PLOS_CNT, ARC_CNT); Where the two variables contain the values. first OBSERVE_TX= means the text that is literally printed %02X is the format of the variable which is printed OBSERVE_TX is the ...


2

Download the bin file over GPRS and then use the Update singleton object. It is declared in Update.h. Example is ArduinoOTAClass::_runUpdate() in ArduinoOTA.cpp or ESP8266HTTPUpdate::runUpdate() in ESP8266httpUpdate.cpp


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