arduino

Getting a value from a Struct Array ARDUINO

允我心安 提交于 2020-01-06 05:46:26
问题 I am having an issue retrieving the values stored in a Struct and have no idea why. I am working on the Arduino IDE 1.8.7 In h file // structure to hold each "display unit" settings typedef struct { int displayState; int pixelState[]; int startLed; // the first LED number EG: 8 if the previous display used 0-7 int endLed; int brightness; int saturation; } struct_displayType;` In setup // display[0] is all leds displayUnit[0].displayState=5; displayUnit[0].brightness=255; displayUnit[0]

How to send complex infrared hex code in arduino

£可爱£侵袭症+ 提交于 2020-01-06 03:16:47
问题 I want to use arduino to control my air conditioner I follow this instruction: http://www.instructables.com/id/Arduino-Remote-Control-Less-10/?ALLSTEPS And i test with ON button of my MP3 remote, In step two, I have result: unsigned int raw1[68] = {9000,4350,600,500,600,500,600,500,650,450,650,500,600,500,600,500,600,500,600,1650,550,1650,550,1700,500,1700,500,1700,550,1650,550,1700,500,1700,550,1650,550,1650,550,600,500,600,550,550,500,600,550,1650,550,600,500,550,550,600,500,1700,550,1700

How to send complex infrared hex code in arduino

微笑、不失礼 提交于 2020-01-06 03:15:07
问题 I want to use arduino to control my air conditioner I follow this instruction: http://www.instructables.com/id/Arduino-Remote-Control-Less-10/?ALLSTEPS And i test with ON button of my MP3 remote, In step two, I have result: unsigned int raw1[68] = {9000,4350,600,500,600,500,600,500,650,450,650,500,600,500,600,500,600,500,600,1650,550,1650,550,1700,500,1700,500,1700,550,1650,550,1700,500,1700,550,1650,550,1650,550,600,500,600,550,550,500,600,550,1650,550,600,500,550,550,600,500,1700,550,1700

Why does ORSSerialPort serialPort:didReceiveData NSData only have single byte?

徘徊边缘 提交于 2020-01-05 13:08:42
问题 From my Arduino, I'm writing multi-byte data to serial with Serial.print("blah"), but in Objective-C, -serialPort:didReceiveData: (provided by ORSSerialPort) only gets this data 1 byte at a time. Occasionally, it'll grab 2 bytes at once, but never all 4. Is this expected? If so, how can I make it receive all 4 bytes at once? Arduino: void loop() { Serial.print("blah"); delay(1000); } Obj-C: - (void)serialPort:(ORSSerialPort *)serialPort didReceiveData:(NSData *)data { NSString *string = [

Having trouble getting my stepper motor to respond to my button sensor in Arduino sketch

跟風遠走 提交于 2020-01-05 10:27:11
问题 I'm using the AccelStepper library to control my stepper motor, and I'm having difficulty figuring out how to get my motor to stop when my button is pushed. I can get the motor to stop once it completes its entire movement from the moveTo command, but I can't get it to stop before it finishes. I've tried using an if statement nested within the while loop I'm using to get the motor to run, but no dice. The code as it stands is as follows: #include <AccelStepper.h> const int buttonPin=4; /

error: 'constexpr' does not name a type m- arduino ide

大憨熊 提交于 2020-01-05 09:29:27
问题 I'm trying to compile this C++ code using the Arduino 1.0.5-r2 IDE #include <cstdint> #include "mcal_reg.h" class led { public: // Use convenient class-specific typedefs. typedef std::uint8_t port_type; typedef std::uint8_t bval_type; // The led class constructor. led(const port_type p, const bval_type b) : port(p), bval(b) { // Set the port pin to low. *reinterpret_cast<volatile bval_type*>(port) &= static_cast<bval_type>(~bval); // Set the port pin to output. *reinterpret_cast<volatile bval

Processing Code "Error, disabling_serialEvent() in Arduino

和自甴很熟 提交于 2020-01-05 09:26:35
问题 I receive this error when trying to run my arduino and Processing Error, disabling serialEvent() for /dev/cu.usbmodem1451 null I am running process 2 and Arduino 1.6.5 on a MAC OSX 10.9.5 I am super new to processing and arduino . I am just trying to use three potentiometers to control the RGB values of the background color. Arduino code: int potPin = 0; //int potPinB = 1; //int potPinC = 2; void setup() { Serial.begin(9600); } void loop() { int val = map(analogRead(potPin), 0, 1023, 0, 255);

Arduino - Processing to save and display the data

白昼怎懂夜的黑 提交于 2020-01-05 04:07:08
问题 Code for my Arduino: #include<EngduinoThermistor.h> void setup() { Serial.begin(9600); EngduinoThermistor.begin(); }void loop() { float temp; temp = EngduinoThermistor.temperature(); Serial.println(temp); delay(1000); } Code for my Processing: import processing.serial.*; Serial port; float x = 0; void setup() { size(500, 400); println(Serial.list()); String portName = Serial.list()[0]; port = new Serial(this, "/dev/tty.usbmodem1411", 9600); } void draw() { } void serialEvent(Serial port) {

Can I put items in a MySQL database directly from my Arduino?

寵の児 提交于 2020-01-05 03:33:31
问题 Is it at all possible to send data to a MySQL database from an Arduino with an Ethernet shield? Currently I have data outputting to a webpage, but I would like to record a history of that data - can I send the data directly to a databse? Alternatively, can I use PHP to capture the data and send it to a database without having a page constantly open, as I would like to record data over a series of days. 回答1: Yes you can, although it might be tediouis. The details of client/server protocol are

Why does TCP connection keep closing while connecting to xively from Adruino GPRS with AT commands?

别等时光非礼了梦想. 提交于 2020-01-04 14:28:32
问题 I'm trying to send data from a cellular-connected arduino temperature sensor to xively.com using AT commands. I can open the TCP connection, but then it immediately closes. Why does the TCP connection keep closing? setup: arduino uno mackbook seeedstudio gprs v2.0 att gophone sim card Here is my Terminal readout: Call Ready AT OK AT+CPIN? +CPIN: READY OK AT+CGATT? +CGATT: 1 OK AT+CIPSHUT SHUT OK AT+CIPSTATUS OK STATE: IP INITIAL AT+CIPMUX=0 OK AT+CSTT="wap.cingular" OK AT+CIICR OK AT+CIFSR 10