arduino

Arduino and Processing Code Error “disabling_serialevent()”

99封情书 提交于 2019-12-13 06:58:55
问题 I am facing the following error in Processing application off and on, sometimes it works perfectly. Error, disabling serialEvent() for COM2 null Here are the codes: Arduino's: void setup() { Serial.begin(9600); } void loop() { int sensorValue1 = analogRead(A0); int sensorValue2 = analogRead(A1); Serial.print(sensorValue1); Serial.write("-"); Serial.println(sensorValue2); delay(1); } Processing's: import processing.serial.*; Serial myPort; // The serial port void setup () { size(1043, 102);

Python and arduino serial communication

我与影子孤独终老i 提交于 2019-12-13 06:26:45
问题 I have a arduino Uno connected to my laptop through USB. I am running WAMP webserver on windows 7. I have python 2.7 and py serial installed. I wrote a HTML where the buttons when clicked will invoke the led1.py (python script). The python script would communicate with the arduino to put on a led and then the user would press another button to putt off the Led. The buttons when pressed are invoking the python script, the led is getting on, but then the HTML page is giving an error: Internal

Matlab reading from serial port at specific sampling rate

℡╲_俬逩灬. 提交于 2019-12-13 06:24:37
问题 I am trying to read values from two sensors (on my arduino) that are being sent to the serial port, with the matlab code below. However, it errors saying ??? Attempted to access sensor1(1); index out of bounds because numel(sensor1)=0 and if the error does not occur the results are not accurate. I know this because I simply sent 1 and 2 as the sensor values to the com port and the resulting two arrays contained some zeros too (when one should be all 1's and the other all 2's). Thanks any help

cc1plus: error: unrecognized command line option “-std=gnu++11”

痴心易碎 提交于 2019-12-13 06:09:52
问题 mac OS X has failed to generate a make file and gives me a problem DOLATs-MacBook-Air:~ dolatsingh$ cd Documents/ardupilot/ArduCopter/ DOLATs-MacBook-Air:ArduCopter dolatsingh$ make apm2 // BUILDROOT=/var/folders/16/slzp9s_s741cb0cgqtcddc_h0000gn/T/ArduCopter.build HAL_BOARD=HAL_BOARD_APM2 HAL_BOARD_SUBTYPE=HAL_BOARD_SUBTYPE_AVR_APM2 TOOLCHAIN=AVR EXTRAFLAGS=-DGIT_VERSION="705d3d56" %% AP_State.o **cc1plus: error: unrecognized command line option "-std=gnu++11" make: ***** [/var/folders/16

Accessing Makefile variables in code?

懵懂的女人 提交于 2019-12-13 05:47:46
问题 UPDATED PROGRESS I am sorry I forgot to specify this question as an Arduino question. I just assumed that it's a preprocessor problem which is kind of independent of what platform this is being executed on. I am using Arduino-Make and I am trying to pass in USERNAME and PASSWORD BOARD_TAG = mega2560 CPPFLAGS = -DUSERNAME="$(USERNAME)" -DPASSWORD="$(PASSWORD)" include $(ARDMK_DIR)/Arduino.mk Command line: make USERNAME="HELLO" PASSWORD="WORLD" Code: void setup() { Serial.begin(9600); String

GCC can't find curl library

家住魔仙堡 提交于 2019-12-13 05:43:32
问题 I have a Dragino Yun Shield (it's an Arduino Yun basically, running OpenWRt Linino) and I have installed GCC on it as explained here: http://www.sniff.org.uk/2014/05/building-gcc-for-yun-in-12-not-easy.html The compiler seems to work fine for my needs (except for some floating point warnings) but I run into a problem. My C program requires the curl library and it can't be found by the linker: gcc -shared -fPIC kii_cloud.c kii_custom.c kii_prv_utils.c -L jansson -I curl -I jansson -l jansson

DHT11 Adafruit Library: Is this parameter necessary?

二次信任 提交于 2019-12-13 05:35:37
问题 See: https://github.com/adafruit/DHT-sensor-library/blob/master/DHT.h In DHT.H the constructor initializes the parameter count=6 DHT(uint8_t pin, uint8_t type, uint8_t count=6); In DHT.cpp I don't see the variable used anywhere. It only mentions: // Note that count is now ignored as the DHT reading algorithm // adjusts itself base on the speed of the processor. _maxcycles = microsecondsToClockCycles(1000); How exactly is this variable being utilized at any moment? 回答1: How exactly is this

Arduino State Machine

扶醉桌前 提交于 2019-12-13 05:28:14
问题 This is a cross-post from someone who answered my original question here. I'm not sure how to go about executing the 3 functions I'm after (as well as introducing even more than 3 in the future). I am simply trying to Fade/Blink the selected Colour of an RGB LED (and perhaps introduce more functions in the future) where its RGB data is coming back from iOS and sent to an RFDuino BLE module. Sends a "fade" string to the module picked up by RFduinoBLE_onReceive (char *data, int len) on the

Custom enum type declaration with Arduino

ⅰ亾dé卋堺 提交于 2019-12-13 05:23:51
问题 I'm having some trouble using a custom enum type in Arduino. I've read elsewhere that using a header file is necessary for custom type declarations, due to Arduino IDE preprocessing. So, I've done that, but I'm still unable to use my custom type. Here's the relevant portions of my code in my main arduino file (beacon.ino) #include <beacon.h> State state; And in beacon.h: typedef enum { menu, output_on, val_edit } State; But, when I try to compile, I get the following error: beacon:20: error:

Why does VirtualWire conflicts with PWM signal in Arduino/ATmega328 pin D10?

廉价感情. 提交于 2019-12-13 05:18:00
问题 After debugging a hardware prototype I'm making with an Arduino-like board and ATmega328, I noticed that the RF library VirtualWire disables PWM signal in pin D10. Why is that? If I comment out the bit of code below, analogWrite (PWM) on pin D10 works again: setup() { ... vw_set_rx_pin(2); vw_setup(2000); // Bits per sec vw_rx_start(); // Start the receiver PLL running analogWrite(10, 180); ... } 回答1: VirtualWire uses CTC on timer 1 via OCR1A, which both completely disables PWM operation for