arduino

how OTA programming for arduino using gsm can be done?

孤人 提交于 2019-12-12 02:14:22
问题 I am doing a project on OTA programming of Arduino at remote place so I need GSM along with Arduino, so how can we do OTA with gsm for Arduino? 回答1: I assume you're asking how you can remotely control an Arduino with your phone, right? I suggest using Bluetooth for this, as it is build into every phone nowadays. You'll still have to buy a module to allow the Arduio to communicate via bluetooth. An example of such a module is the HTC-06, wich can be bought online for less then $10 and for wich

Sum calculation error in Arduino Mega 2560

扶醉桌前 提交于 2019-12-12 01:58:29
问题 I am using Arduino Mega 2560 to communicate with the server. I create a byte array, uses the first digit as a indicator (to tell the server this message is from a arduino device) and the last digit for check sum. // for creating msg void createmsg(){ int index = 0; memset(MSGpack,0,sizeof(MSGpack)); byte sum; MSGpack[0] = 0x23; // for identifing it is arduino // for current readings index = 14; for (int i = 0; i < 7; i++){ float voltage = readcurrent(i); injectByte(voltage, index); index =

How to plot graphs with data from a SerialPort with multiple sensors

删除回忆录丶 提交于 2019-12-12 01:52:43
问题 I need to plot data from sensors of pH, Temperature and Humidity, the data is sent as a matrix from arduino to PC through the serial port. I can show the data in a TextBox, but when I try to plot the data, it doesn't work (I don't know how to do it). I just can plot the data when is not a matrix and it's data from just one sensor. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using

Executing multiple functions/commands on Arduino

◇◆丶佛笑我妖孽 提交于 2019-12-12 01:43:08
问题 I am using an RFduino and an iOS application to control some RGB LEDs. This is how I'm sending a string command to the module: - (IBAction)fadeButtonPressed:(id)sender { [rfduino send:[@"fade" dataUsingEncoding:NSUTF8StringEncoding]]; } These command(s) are coming back just fine on the RFduino side: void RFduinoBLE_onReceive(char *data, int len) { if (strncmp(data, "fade", 4) == 0) { // begin fading chosen LED colour } } Is there a better way of executing multiple functions on Arduino? It

Connect an Arduino Ethernet to localhost:8000

孤人 提交于 2019-12-12 01:42:31
问题 I have an Arduino connected via Ethernet to my computer and a webserver is running on localhost:8000. computer IP: 192.168.1.5 arduino IP: 192.168.1.6 The connection between Arduino and Computer is technically working and I even could establish a connection between the arduino and the computer on port 80 but when I start the webserver (it is a symfony project) and commandline confirms 'server running on localhost:8000' and try to connect to '192.168.1.5:8000' from the arduino it fails. What

Convert binary hex data to ASCII equivalent and store in String

我与影子孤独终老i 提交于 2019-12-12 01:37:08
问题 I am using C++ on Arduino. Suppose I have a stream of binary data; binary data: 0xFF, 0x00, 0x01, 0xCC I want to convert it to the ASCII equivalent and store it in a String object type. The converted string should look like this "FF0001CC". Here are some draft code. char buffer[100]; String myString; for (int i=0; i < numBytes; i++) { //assume buffer contains some binary data at this point myString += String(buffer[i], HEX); } The problem with this code is that myString contains FF01CC , not

“Unable to resolve library include path” visual studio(visual micro)

筅森魡賤 提交于 2019-12-12 00:35:12
问题 I'm using visual studio 2013 and visual micro as add ones for arduino coding. If I run my code in arduino IDE ,code compiles fine but when I compile the same code in visual studio , it says "Unable to resolve library include path 'SPI'" I include those libraries via visual micro and it shows all of them. So I guess it's not that my library directory is wrong. How can I solve this problem ? what may be the reason for this? thanks 回答1: It seems you forgot to include Library directories to

Convert string to float occurs NaN error in Processing

别来无恙 提交于 2019-12-12 00:23:14
问题 I meet a problem in the Processing, and when i convert the value(string) into float, the first value is good, but the rests are all NaN . I could not find a way to solve this. And i print the string value for test. And it is correct, but after i convert it into float. It will be NaN . ps: the value is from the serial, i connected my Arduino with Proceesing. following is a part of codes while(myport.available() > 0) { myString = myport.readString(); //read the string from serial num = float

How to easily parse the AT command response from a GSM module?

雨燕双飞 提交于 2019-12-11 23:29:38
问题 I'm trying to parse the following output taken from a GSM module in Arduino, to get the Voltage ( 3.900V ) part only. However, I can't get it to work. " +CBC: 0,66,3.900V OK " I have tried the following code, but it fails and even crashes. float getVoltage() { if (atCmd("AT+CBC\r") == 1) { char *p = strchr(buffer, ','); if (p) { p += 3; // get voltage int vo = atof(p) ; p = strchr(p, '.'); if (p) vo += *(p + 1) - '0'; // ?? return vo; } } return 0; } How can this be done in a better or more

How to get numbers from sd card?

久未见 提交于 2019-12-11 21:14:42
问题 I am bad at coding. I have a file called Test.cal in sd card contained 6 numbers. 20,21,22,23,24,25 But I do not know how to get this six number. Can someone help me ? Below is my own thought about the coding. #include <SD.h> float meterTemp[6]; String theLines[15]; File myFile; void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { ; // wait for serial port to connect. Needed for Leonardo only } Serial.print("Initializing SD card..."); /