arduino

Call function on lcd object in class

旧城冷巷雨未停 提交于 2021-01-28 22:47:12
问题 Currently i'm making a class for printing custom text to a LCD. I pass the lcd object as paramter in the constructor to the class. Display.h #ifndef Display_h #define Display_h #include <Wire.h> #include <LiquidCrystal_I2C.h> #include "Arduino.h" class Display { public: Display(LiquidCrystal_I2C *outsideLcd); private: LiquidCrystal_I2C *lcd; }; #endif Display.cpp #include "Arduino.h" #include <Wire.h> #include <LiquidCrystal_I2C.h> #include "Display.h" Display::Display(LiquidCrystal_I2C

ESP8266 - Response from server gets cut

自古美人都是妖i 提交于 2021-01-28 11:41:52
问题 I'm using an ESP8266 connected to an Arduino one via SoftwareSerial to make a post request to a node web server. The ESP8266 sends some data to the server and it should get back other data. The data arrives at the server correctly, but the response from the server is incomplete (it gets cut each time in a different way) and I can't access the body of the response from my Arduino sketch. The server sends the response correctly, as i've checked with hurl. This is my code: #include

How can I have a conditional statement that performs two tasks? first one and then the other in a loop

怎甘沉沦 提交于 2021-01-28 09:01:06
问题 So I am trying to code a program in arduino that does a task for 2 minutes and then another task for 5 mins. first one and then the other in a loop until a different condition is met. Ive been trying to do this with if statements and while loops but im getting lost in the time part i think //Pneumatic feed system double minute = 1000*60; double vibTime = 2 * minute; //2 mins //double vibTime = 5000; double execTime = millis(); double waitTime = 5 * minute; //time waits between vibrating /

Converting a byte array to an image file

有些话、适合烂在心里 提交于 2021-01-28 07:40:30
问题 I have an Arducam hooked up to an Arduino UNO over SPI. I am having the camera take a photo and send the data back over SPI to my Arduino. I have a python script that is capturing the serial output from the camera (which should be the image data) and saving it to a text file. My python code for saving the data to a text file looks something like this: import serial import time ser = serial.Serial('/dev/cu.usbmodem621', 115200) f = open('data.txt','a') #pause to let everything get warmed up

Empty #define in .vsarduino.h (Visual Micro)

不羁岁月 提交于 2021-01-28 07:32:31
问题 I'm using Visual Micro to write code for an Arduino (Nano in this case) in Visual Studio 2012. I have a compile error in the generated .vsarduino.h file, an empty #define is being generated and I'm not sure where it is coming from: .vsarduino.h #ifndef _VSARDUINO_H_ #define _VSARDUINO_H_ //Board = Arduino Nano w/ ATmega328 #define __AVR_ATmega328P__ #define #define _VMDEBUG 1 回答1: Sorry we missed this question. Hopefully it was answered in the Visual Micro forum. The vsarduino.h is not

Converting a byte array to an image file

最后都变了- 提交于 2021-01-28 07:21:33
问题 I have an Arducam hooked up to an Arduino UNO over SPI. I am having the camera take a photo and send the data back over SPI to my Arduino. I have a python script that is capturing the serial output from the camera (which should be the image data) and saving it to a text file. My python code for saving the data to a text file looks something like this: import serial import time ser = serial.Serial('/dev/cu.usbmodem621', 115200) f = open('data.txt','a') #pause to let everything get warmed up

Setting up a computer to act as an HID device connected to another computer via ps/2,usb or another wired connection

馋奶兔 提交于 2021-01-28 04:21:16
问题 I’m interested in setting up a machine (host A) and connect it to another one (host B) via usb or ps/2 such that host B will recognise host A as a keyboard. On host A an artificial neuronal network is running which generates dynamically input sequences. It’s important to me that host A can only communicate to host B in a “human” way, e.g. generating keystrokes and passing them to host B. As far as I know this is not possible with an usb connection since a host to host connection is not

ESP8266 I2C slave does not acknowledge data

你。 提交于 2021-01-28 04:20:26
问题 I have a TM4C123 processor acting as a I2C master and a ESP8266 as a slave. For the ESP I am using the Arduino IDE with ESP8266 support installed at version 2.5.2, which should support the I2C slave mode. However, I can't get it to work. Even with the Arduino slave_receiver example, the slave does not acknowledge (ACK) the master's requests which I am displaying on a scope. To make sure I am using the right address at least once, I implemented an address sweep on the master. And to make sure

Raspberry pi 2 and BMP280 : Slave address was not acknowledged

社会主义新天地 提交于 2021-01-27 12:18:10
问题 I follow the project WheatherStation on https://www.hackster.io Windows IOT. I downloaded project on github and connected my BMP280 sensor on Raspberry. You can check my connections on http://kdamerval.fr/WeatherStation/1.jpg http://kdamerval.fr/WeatherStation/2.jpg For me, it's correct, but i have an exception with bmp280.WriteRead(WriteBuffer, ReadBuffer); System.IO.FileNotFoundException: The system cannot find the file specified. Slave address was not acknowledged. 回答1: There are a couple

Can't load external css when in localhost

风流意气都作罢 提交于 2021-01-27 10:47:34
问题 I'm working on a project using arduino, node.js and socket.io. I am running it in localhost, however my external stylesheet wont load. The error seems to be saying it cant get my css from this path http://localhost:1337/css/main.css However if i keep the css in a style tag in the html file it all works fine, is there a way to keep the css external so it doesnt clutter my html file? Heres how im loading in my css <link rel="stylesheet" type="text/css" href="css/main.css"> Here is how my file