arduino

Incompatible types in assignment of ‘int’ to ‘int [2]’

落花浮王杯 提交于 2019-12-11 06:53:48
问题 In Arduino I have an error. incompatible types in assignment of ‘int’ to ‘int [2]’ long received; long received_t; long received_m; int arra[2]; void setup() { analogReference(INTERNAL); Serial.begin(9600); } void loop() { while( Serial.available() > 0) { arra = Serial.read(); Serial.println(arra[0]); Serial.println(arra[1]); } } 回答1: How about while( Serial.available() > 1) { arra[0] = Serial.read(); arra[1] = Serial.read(); Serial.println(arra[0]); Serial.println(arra[1]); } ? Still not

Sizeof() difference between C++ on PC and Arduino [duplicate]

五迷三道 提交于 2019-12-11 06:36:55
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Why isn't sizeof for a struct equal to the sum of sizeof of each member? In the following code, the value of structSize is different depending on whether it's executed on an Arduino vs my PC (Ubuntu 11.04 x64). struct testStruct{ uint8_t val1; uint16_t val2; }; ... uint_8_t structSize = sizeof(testStruct); On my PC, the value of structSize is 4, and on my Arduino the value of structSize is 3 (as expected). Where

How to determine checksum from decoded IR remotes

十年热恋 提交于 2019-12-11 06:32:40
问题 I have a small 3.5ch USeries helicopter controlled by an IR remote control, using an Arduino I have decoded its 32 bit protocol. Except for last 3 bits which appear to be some form of checksum. As I have successfully decoding the channels from the remote, in that they track their corresponding controls, I can see that slight changes in the controls yield specific changes in the 3 bits, that are very reproducible and deterministic. Whereas I have not yet found a common theme or formal to

Arduino ESP8266 AT GET Request

醉酒当歌 提交于 2019-12-11 06:25:23
问题 I'm having trouble to send data to my database with the ESP8266-01. I'm getting the correct data from the sensor in the Console but nothing in my Database. The PHP Script is correct, I know that, just to be sure, I'm gonna add it in here too. My Code: // http://playground.arduino.cc/Main/Average #include <Average.h> #include <SoftwareSerial.h> char serialbuffer[100];//serial buffer for request url SoftwareSerial mySerial(10, 11); const char* ssid = "Master"; const char* password = "#Bennet99*

Arduino Sketch works with Serial Monitor but not with pyserial

流过昼夜 提交于 2019-12-11 06:17:34
问题 I am testing this simple arduino code in python but it works in arduino serial not in python. User defines the number of blinks on the led. This works on arduino serial monitor. But when I use it in python it does not work. can anyone help? Thank you Arduino code: int ledPin = 13; // select the pin for the LED int val = 0; // variable to store the data from the serial port void setup() { pinMode(ledPin,OUTPUT); // declare the LED's pin as output Serial.begin(9600); while (!Serial) { ; // wait

Visual Studio 2010 Arduino serial communication

£可爱£侵袭症+ 提交于 2019-12-11 06:14:20
问题 I am using OpenCV in Visual Studio 2010 to track an object, and I am trying to send a value to the Arduino to rotate servos attached to the camera. I am using an Arduino Uno. I have completed the C++ code that tracks the object and determines which direction the camera needs to be rotated, but I am having trouble sending this data to the Arduino. I am currently trying to use an RS-232 cable for this. I am using a Type-B USB cable to program my Arduino and an RS-232 to try to send the data

HC-05 bluetooth module on Arduino + Debugging

一曲冷凌霜 提交于 2019-12-11 06:01:00
问题 I'm kind of stuck here. I have a HC-05 Bluetooth module - from ebay- and i'm testing it to make certain it works. I have uploaded the following sketch to the chip: ////////////////////////////////////////////////////////////////////////////////// // REMIXED BY: TECHBITAR (HAZIM BITAR) // LICENSE: PUBLIC DOMAIN // DATE: MAY 2, 2012 // CONTACT: techbitar at gmail dot com char INBYTE; int LED = 13; // LED on pin 13 void setup() { Serial.begin(9600); pinMode(LED, OUTPUT); } void loop() { Serial

LUA Programming ,ESP8266 NODEMCU Serial communication

南笙酒味 提交于 2019-12-11 05:58:17
问题 I am trying to send data over the serial port of the ESP8266 12E NODE MCU dev kit to an arduino serial port. I've having a hard time trying to find an example of the syntax used and I tried using serial.print() via the arduino to send data and it works but I'm unsure how to accomplish this in Lua. Any help is appreciated I can get the SSID and Password form arduino INIT.lua SSID = "XXXX" Password = "XXXX" wifi.setmode(wifi.STATION) wifi.sta.config(SSID,Password) -- Replace with your AP Name

Adding to c* invalid conversion from const char* to char*"

血红的双手。 提交于 2019-12-11 05:40:50
问题 I have the function below in a file called WiServer.h for Arduino. GETrequest(uint8* ipAddr, int port, char* hostName, char* URL); Now the problem is I need to concatenate an int value (setting1) to the char* URL parameter like the below for example. "twittermood.php?status=sendTweet&setting1="+setting1 I get an error: invalid conversion from const char* to char* How do I fix it? 回答1: You've gotten decent generic C++ advice, but for the special case of Arduino on an 8-bit AVR microcontroller

AVR SBI or CBI on Higher Ports H+

烈酒焚心 提交于 2019-12-11 05:39:12
问题 I have a problem on using CBI or SBI in avr assembly, when working with Port H through L. From the documentation [http://www.atmel.com/webdoc/avrassembler/avrassembler.wb_SBI.html] the SBI takes parameter of 5 bit only which if I am using port H or higher, the address from _SFR_IO_ADDR(PORTH) will exceed the allowed range. Is there any alternative to achieve this? Thanks. 回答1: You need to LD the value, perform the OR or AND necessary to manipulate the bits, and then ST the value back. Unless