arduino

Android - Reading http request

青春壹個敷衍的年華 提交于 2020-01-07 00:27:32
问题 I'm doing a project with Arduino and Android application. Here's how it goes, send from the application request "a=11&b=22&d=33" (http://192.168.0.17/?a=11&b=22&d=33), arduino read and return "Data_received" and I use it to do something (down is part of code from app). And everything is going well. But I do not know how to do reversed now, I know how to send the request from arduino to server, but I don't know how to receive in android app to get a = 11, b = 22, c = 33. Android studio code to

Arduino c++ classes, How to make instance variables of another class/library

一曲冷凌霜 提交于 2020-01-06 22:00:46
问题 I'm working with an Arduino UNO in my first attempt to use the OO in Wiring. I just have a question which I need help with; I'm using a class for a DHT22 sensor from freetronics, found here http://www.freetronics.com/products/humidity-and-temperature-sensor-module. Say I have a class i made called Sensor, where DHT is the library for the freetronics sensor, and DHT dht(5, DHT22) Initialises the sensor on pin 5 (which could be any digital pin): #include "arduino.h" #include <DHT.h> DHT dht(1,

Arduino c++ classes, How to make instance variables of another class/library

一个人想着一个人 提交于 2020-01-06 21:59:31
问题 I'm working with an Arduino UNO in my first attempt to use the OO in Wiring. I just have a question which I need help with; I'm using a class for a DHT22 sensor from freetronics, found here http://www.freetronics.com/products/humidity-and-temperature-sensor-module. Say I have a class i made called Sensor, where DHT is the library for the freetronics sensor, and DHT dht(5, DHT22) Initialises the sensor on pin 5 (which could be any digital pin): #include "arduino.h" #include <DHT.h> DHT dht(1,

Receiving data from Arduino to Android. Data is wrong

风流意气都作罢 提交于 2020-01-06 19:36:35
问题 Hi I trying to receive data from Arduino to Android phone. The Android coding is below: App crashed due to looper.prepare() in the beginlistendata() function The Arduino code is below: void setup() { Serial.begin(9600); eHealth.initPulsioximeter(); //Attach the inttruptions for using the pulsioximeter. PCintPort::attachInterrupt(6, readPulsioximeter, RISING); } void loop() { delay(500); Serial.print("PRbpm : "); Serial.print(eHealth.getBPM()); Serial.print(" %SPo2 : "); Serial.print(eHealth

Programming Arduino with ADXL345 to raise interrupt on inactivity

有些话、适合烂在心里 提交于 2020-01-06 18:01:33
问题 I need to use a sparkfun breakout board ADXL345 to detect when my motor system has stopped vibrating. I am also using a Sparkfun RedBoard (Arduino uno). Things I am doing to configure for this behavior: enable INACTIVITY event route INACTIVITY events to INT 1 (pin 2 on the RedBoard) raise INACTIVITY interrupt without delay set low threshold for INACTIVITY (rule out too high of a setting) INACTIVITY considers all axes clear interrupt data register Having done all these things I do not receive

Programming Arduino with ADXL345 to raise interrupt on inactivity

我是研究僧i 提交于 2020-01-06 18:01:27
问题 I need to use a sparkfun breakout board ADXL345 to detect when my motor system has stopped vibrating. I am also using a Sparkfun RedBoard (Arduino uno). Things I am doing to configure for this behavior: enable INACTIVITY event route INACTIVITY events to INT 1 (pin 2 on the RedBoard) raise INACTIVITY interrupt without delay set low threshold for INACTIVITY (rule out too high of a setting) INACTIVITY considers all axes clear interrupt data register Having done all these things I do not receive

Arduino Sim900 with no echo but SMS was sent out

送分小仙女□ 提交于 2020-01-06 17:36:44
问题 I just got a new Sim900 and connected to an Arduino Uno. I used the code below to send a text to myself. I received the text on my cell, but I did not receive any echo on my serial monitor (ie. "OK"). I have tried swapping the RX/TX pins and different baud rates with no success. void setup() { Serial.begin(9600); //Baud rate of the GSM/GPRS Module Serial.println(""); delay(2000); Serial.println("AT+CMGF=1"); delay(1000); Serial.println("AT+CMGS=\"+120########\""); //Number to which you want

How to background a sleep in arduino?

我的未来我决定 提交于 2020-01-06 14:17:29
问题 I am just starting with arduino and I already love it. One of the projects I would like to try deals with the follwing pseudo-code flow: def switch(): set_pin_2_to_HIGH wait_10_seconds set_pin_2_to_LOW loop() // some time sensitive code, which should be executed on a // reasonably regular cycle if_pin_1_is_HIGH: switch() // some more code where the state of pin_2 will be tested, that code also need // to run in a reasonably regular cycle I therefore need the loop to loop without stopping 10

Anyone have a code to convert char array to HEX ? And return back to the actual results?

做~自己de王妃 提交于 2020-01-06 06:01:40
问题 Anyone have a code to convert char array to HEX? And return back to the actual results? Because when I try to use this: char data[]="hello word"; Serial.print(data,HEX); then will give me an overload error. 回答1: For brute force, you could try: for (size_t i = 0; i < sizeof(data) - 1) { Serial.print(static_cast<unsigned int>(data[i]), HEX); } In the above snippet, each character is casted to an integer to get the internal representation value, then output. There may be more efficient methods,

UnsatisfiedLinkError using Serial port from Processing in Eclipse

放肆的年华 提交于 2020-01-06 05:59:08
问题 I have a processing program that is supposed to read the data from a serial port created by an arduino uno. I got the program to work perfectly in Processing but not in Eclipse. I added core.jar serial.jar and jssc.jar to my java project's build path, but am still getting an error calling the port with Serial.list()[0] . I have seen similar questions on here, but none have helpful answers. I don't know if I'm missing something or need to import a different jar file to my build path. import