22

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

@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.


9

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( //...


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 ...


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

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

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

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

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

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 ...


4

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 ...


4

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 ...


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

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

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

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 ...


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

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

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

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 ...


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

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

Read SparkFun's guide, Serial Peripheral Interface (SPI), especially the multiple slaves section: Multiple slaves There are two ways of connecting multiple slaves to an SPI bus: In general, each slave will need a separate SS line. To talk to a particular slave, you'll make that slave's SS line low and keep the rest of them high (you don't ...


2

You need two supply voltages for this board to work: motor supply, which goes directly to your motor (up to 35V for this L298N board, depends on what your motor needs), and logic supply of 5V, which powers the board's logic chips. If the motor supply voltage is between 7V and 12V, you can derive 5V logic supply from motor supply by enabling this board's ...


2

This is a known problem with those chips (especially Chinese clones). It is caused when a chip gets stuck in TX mode waiting for an ACK that never arrives back. The chips don't have a "reset", but switching them into low power mode and then back on again, which doesn't affect any register settings, aborts the current TX operation. RF24Network is merely a ...


2

In short: you have your macro backwards. Macros are not formed as "Take this set of commands and call it X" but "Make this macro X and have it equate to this set of commands". Where you have: #define Serial.println(x) DEBUG_PRINT(x) it should instead read: #define DEBUG_PRINT(x) Serial.println(x) When you call it, because the macro doesn't contain a ...


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