arduino

Arduino - combine sketches

。_饼干妹妹 提交于 2019-12-11 10:59:37
问题 New to programming and Arduino.. I'm currently making a project for my son's Gold Rush diorama with added electronics. From my understanding, it does not like reading delay() codes. Please, any suggestions are appreciated. Thank you. I'm trying to combine two sketches; One that has random fluctuating LEDS (acts as the lanterns in the mine shafts) The other, a servo that pulls a string up and down (acts as an elevator pulley) Each sketch alone works properly. I'm not sure the proper way to

SerialSocketEvent not firing

拥有回忆 提交于 2019-12-11 10:26:11
问题 I have copied this code:http://playground.arduino.cc/Interfacing/Java to a java project, and i tried this: void setup(){ Serial.begin(9600); while(!Serial); } void loop(){ Serial.println("Test"); } on my arduino UNO, with great results, but when i tried it on my esplora, the program did not even fire the event listener for the java project. 回答1: An Esplora and leonardo (both use ATmega32u4) require you to wait until the cdc serial is ready. The Uno has a dedicated Atmega8/16u2 controlling the

Cannot upload data to firebase using Nodemcu

江枫思渺然 提交于 2019-12-11 10:14:38
问题 My sensor is collecting data correctly but is not pushing the data to Firebase. As expected Firebase.failed returns true but Firebase.error is empty. Please help me with the code as my project is due in three days. I have tried changing the fingerprint in FirebaseHttpClient.h file. I have also tried changing the Firebase HOST with and without "/". #include "DHT.h" #include <FirebaseArduino.h> #include <ESP8266WiFi.h> #define FIREBASE_HOST "your-project.firebaseio.com" #define FIREBASE_AUTH

Error with receiving xml strings via bluetooth in Android

你说的曾经没有我的故事 提交于 2019-12-11 10:13:25
问题 i am developing an App which receives xml as String over bluetooth (from Arduino and android phones). I am getting invalid/incomplete strings from the bluetooth . the Bluetooth is defined as an Android service. Every time i receive a string its not in its original form no mater i send it from arduino or other android phone. the xml parsing function is working i have checked that. Here is my code where i am receiving the string mConnectedThread = new ConnectedThread(btSocket); mConnectedThread

Android/Arduino bluetooth communication

人走茶凉 提交于 2019-12-11 10:09:21
问题 Link successfully established and able to send data. Android is sending SeekBar data when ever we change it. public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if(seekBar.getId() == R.id.seekBar) { speed.setText(String.valueOf(progress)); String outputData = String.valueOf(progress); streams.write(outputData.getBytes()); } } streams.write() writes data to the OutputStream of the Socket . Problem is with the format of data.If I Send '25' arduino is receiving '2',

Arduino local DNS problems

独自空忆成欢 提交于 2019-12-11 09:57:55
问题 I'm trying to build a little project using the Arduino Ethernet library, but I'm having a weird DNS issue: It cannot resolve any domain name that is local to my network, but it has no problem resolving public domain names . No other system on my network has problems with these local domain names. It just seems to be the Arduino. Here's what I'm using: Arduino Uno R3 Arduino Ethernet Shield R3 Arduino IDE 1.0.3 Asus RT-N66U Router (provides the DNS server) Here's my test sketch: #include <SPI

Arduino Uno + ESP8266 reading server's response

大憨熊 提交于 2019-12-11 09:48:40
问题 I'm sending a GET request from Arduino Uno using ESP8266. The request is sent, but I'm unable to print the received response. I'm using code from https://elementztechblog.wordpress.com/2015/05/13/esp8266-based-temperature-data-logger-using-arduino/ I have changed the code for connecting to my server and I can see the GET request is received on my server's log. I tried putting while (ser.available()) { Serial.write(ser.read()); } after the Serial.println("AT+CIPCLOSE"); statement. BUT I'm not

Arduino UNO, CC3000: while(client.connected)

我怕爱的太早我们不能终老 提交于 2019-12-11 09:37:41
问题 I'm playing around with an Arduino UNO and a CC3000 shield connecting to a remote web service. Though I'm having a problem looping the script. As you can see in the code below, the script should ping the web service with the state of occupied every 5 seconds. Though when using while(client.connected) something makes the Arduino stop/hang forever. Even if the while(client.connected) {} is just empty. If I don't include the while(client.connected){} the web service is not pinged, which is why I

Convert bytes in a C array as longs

回眸只為那壹抹淺笑 提交于 2019-12-11 09:31:51
问题 I have a byte array in little endian byte order. How do I convert it to a long (four bytes) array? In layman's terms, I want to merge every four bytes. 回答1: byte b[4]; // Contains bytes int x= 0; x= (x << 8) + b[3]; x= (x << 8) + b[2]; x= (x << 8) + b[1]; x= (x << 8) + b[0]; I quickly wrote a sample. It's not tested, though. unsigned char b[35]; int sizeOfB = sizeof b / sizeof(unsigned char); int sizeOfL = sizeOfB / 4; if(sizeOfB % 4 != 0) ++sizeOfL; int lcount=0; long* l = new long[sizeOfL];

Setting up host card emulation

五迷三道 提交于 2019-12-11 09:22:55
问题 I am currently attempting to connect between an Arduino UNO with NFC Shield to my Nexus 4 running Android 4.4. I have the service setup, it's simply logging at the moment. Problem is, the NFC intent doesn't get bound to my app. The debugger reports the following error: 11-24 02:45:46.139 4006-4027/? E/BrcmNfcNfa﹕ UICC[0x0] is not activated So here's my 2 questions: On the Arduino side of things, what kind of 'message' does the NFC shield needs to send to my phone for my phone to understand