arduino

Issues with 'StandardCplusplus' Library in Arduino

左心房为你撑大大i 提交于 2019-12-13 19:24:43
问题 I had to write some code for Arduino in C++. The code works perfectly, but wouldn't work in Arduino as I had used some libraries like vectors, ifstream, etc. So I included the StandardCplusplus library. I downloaded the zip version of the library. I copied the extracted version into the library folder of Arduino. Now the vector library works, i.e. it doesn't give any compile error. But on #include fstream , Arduino gives the following error: fatal error: unistd.h: No such file or directory

Windows 10 IOT serial - Working on RP2 but read serial data incomplete

浪子不回头ぞ 提交于 2019-12-13 19:13:45
问题 So I have been experimenting with the IOT serial sample and RP2 since the october release opened up the serial pins. Im using the windows iot serial sample. Have a few issues i cant figure out. The read data seems incomplete. I have an arduino outputting an analog input reading through the serial at 9600 baud. On the windows universial app, ill read one complete line then one incomplete line. For example: if the arduiono is outputting a value of "2.25", the app will read one line 2.25 then

Is it possible to use the mousedown and mouseup event on the same button?

被刻印的时光 ゝ 提交于 2019-12-13 18:12:09
问题 This project involves controlling a toy car over LAN. On my html page, there are 5 "buttons";up, down, left, right, stop. My code works like this: Say the user clicks on "up", a value gets sent to a php page for processing and the processed string gets printed on another php page for an arduino to read. For the car to stop, the user has to click on stop. <html> <head> </head> <form name="motorform" action="motorboardprocess.php" method="post"> <tr><p align='center'><font face="BN machine"

How do I refresh/update QLabel with data from USB serial (from Arduino)?

こ雲淡風輕ζ 提交于 2019-12-13 18:08:54
问题 I know this is a NOOB question; forgive me. I built a Pinewood Derby race timer (small car track) for Cub Scouts using a combination of an Arduino to control timing and RasPi for GUI display of lane place (1st, 2nd, 3rd, etc.) and run time in seconds (e.g. "2.1234"). I have the basic shell GUI setup in QT Creator and have successfully connected the Arduino & RasPi via USB. I am also successfully pulling the Arduino serial data into RasPi (tested with separate small Python code). Problem I am

Storing string from arduino to text file using python

蹲街弑〆低调 提交于 2019-12-13 15:35:13
问题 I am using this code to send a string from arduino to PC int i=0; void setup(){ Serial.begin(9600); // Open serial connection at a baud rate of 9600 pinMode(13, OUTPUT); //set pin13 in o/p mode } void loop(){ while(1) { Serial.write("10.028371,76.328873"); Serial.write('\0'); delay(1000); } } I need a python code that receives this string and store it in a text file as such.The arduino is transmitting this string continuously but i need it only once in the text file. I have written the below

Arduino Serial Communication not receiving entire message

ⅰ亾dé卋堺 提交于 2019-12-13 15:19:14
问题 I have a problem with the Arduino communication. It's quite hard to describe so I cant fit it in the title. Anyway here are the following: So I have this code for my receiving end: if(Serial1.available()) { while(Serial1.available()) { uint8_t inByte = Serial1.read(); inByte = inByte ^ k; Serial.write(inByte); } Serial.println(" done"); } It's supposed to print in one line and print done when it's done. The Serial1.available() seems to skip the next Serial1.available() , I don't know what's

C++: closure to pass member function as normal function pointer

一个人想着一个人 提交于 2019-12-13 14:23:30
问题 I'm trying to call a member function of an external library which takes a function pointer as a parameter: Timer::every(unsigned long period, void (*callback)(void)); But unfortunately the parameter I want to pass is a member function: void MyClass::the_method_i_want_to_pass(void); Since I'm programming for the ATMega under Arduino (AVR) there is just limited support of c++11. My first approach raises a type error: void MyClass::the_method_i_want_to_pass() {...} MyClass::MyClass() { //

Mismatched RXTX Versions

∥☆過路亽.° 提交于 2019-12-13 13:23:46
问题 I found a code to communicate in Java via Serial Port to an Arduino and wanted to try and get it working in order to expand on it for a project idea, but I keep getting this error Stable Library ========================================= Native lib Version = RXTX-2.2-20081207 Cloudhopper Build rxtx.cloudhopper.net Java lib Version = RXTX-2.1-7 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7 native lib Version = RXTX-2.2-20081207 Cloudhopper Build rxtx.cloudhopper.net Could not find COM

what does type error mean in Arduino

会有一股神秘感。 提交于 2019-12-13 10:42:02
问题 I am building a weather station using my friend's code. However, he an older verison of Arduino and I'm having trouble figuring out why. I am new to programming, so I don't know what "'dht' does not name a type" means? I'm using Arduino 1.04 and my friend coded his weather station on Arudino 0022. My question is, why isn't my verification able to compile? What am I doing incorrectly? Here's my code: #include <dht.h> dht DHT; #define DHT22_PIN 2 #include <Wire.h> #define BMP085_ADDRESS 0x77 //

control servo using android

时光总嘲笑我的痴心妄想 提交于 2019-12-13 09:36:12
问题 Asked question master, how to coding in arduino for controlling servo using android via bluetooth? Code below does not work, servo only runs between 48 - 56. #include <SoftwareSerial.h> #include <SoftwareSerial.h> #include <Servo.h> Servo servo; int bluetoothTx = 10; int bluetoothRx = 11; SoftwareSerial bluetooth(bluetoothTx, bluetoothRx); void setup() { servo.attach(9); Serial.begin(9600); bluetooth.begin(9600);} void loop() { //read from bluetooth and wrtite to usb serial if(bluetooth