arduino

Making a UDP class which doesn't block an ESP8266 / Arduino

拜拜、爱过 提交于 2019-12-13 09:06:06
问题 I have a need in my Arduino compatible project to listen on an ESP8266 to a specific UDP port and respond when an appropriate message is received, whilst doing other application stuff in the main program loop. I want to abstract the UDP stuff into its own class, and this is where my question comes. How do I let my class continue to listen, read a UDP packet, and then call a send response method, without putting lots of code into the main program loop? The interface for my class is: #ifndef

Rs232 arduino issue

末鹿安然 提交于 2019-12-13 08:56:16
问题 I have a little confusing about arduino uno. I use Serial.print("hi") code then it "hi" appears on the serial monitor. I also use rs232/ttl converter which are connected pin 1 and 0 on the arduino properly. Then I realize that when serial.print("hi") working the data first is going through usb cable. But I want the data has to go through tx rx pins which are 1 and 0. But when I enter some data from serial monitor , rs232/ttl will work and some data will be sended ? I do not understand the

Arduino LED On/Off TCP C#

删除回忆录丶 提交于 2019-12-13 08:45:48
问题 I am now for Arduino, I want try to open switch on/off a led using C# with Arduino. So I try using serial port, and it works, but I want to use an Ethernet shield to switch on/off the led. My code using serial port This Arduino code #define BaudRate 9600 #define LEDPin 10 char incomingOption; void setup() { pinMode(LEDPin, OUTPUT); // serial communication Serial.begin(BaudRate); } void loop() { //read from serial port getting information from VS 2013 incomingOption = Serial.read(); //verify

java - how to pass multiple parameters over serial port to Arduino mega

别等时光非礼了梦想. 提交于 2019-12-13 08:26:32
问题 Through my java program. i want to pass a byte value to the Arduino mega to blink an Led and also at the same time i want to pass a string value to the Arduino to be displayed in the lcd. How can I separately get above 2 inputs from the java program to Arduino and use them in different processes inside Arduino.. Below is the arduino code LiquidCrystal lcd (12, 11, 10, 9, 8, 7); int operation; void setup() { lcd.begin(16, 2); Serial.begin(9600); Serial1.begin(9600); Serial2.begin(9600);

How to send internet packets between two Arduinos?

本小妞迷上赌 提交于 2019-12-13 07:49:02
问题 For a project I am working on, I am wondering if there is a way to send internet packets between two Arduinos. The setup would be to have both Arduinos have ethernet shields. One shield is connected to a computer and the other to a router or other internet connection. The Arduinos need to communicate to each other relaying the packets of information. The goal is to be able to ping the router from my computer through these two Arduinos. Any help would be greatly appreciated. Thank you. 回答1:

How to connect RC522 RFID module and SD-Card Adapter to one Arduino board?

狂风中的少年 提交于 2019-12-13 07:48:41
问题 I want to store the log of RFID tag into the Micro SD card, but RFID and SD card having MOSI and MISO. So i want to know how to connect RFID and SD card to one Arduino UNO. 回答1: Pins named MOSI and MISO indicate an SPI bus. There should also be a pin labeled SS, CS or similar (slave select). you can hook up several slaves to one master and select the device you want to talk to using that pins logic level. There should be tons of tutorials and examples online. 回答2: You can connect multiple

Solving “redeclared as different kind of symbol” error

狂风中的少年 提交于 2019-12-13 07:26:02
问题 I'm currently working on Arduino. I'm working for Lamp using Atmega1284. I saw an example code, ModbusIP_ENC28J60 -> Lamp. I first compiled it without adding anything, it compiled properly. Now, I'm adding WebSocketServer, since I want this to work on websocket too. I added few necessary lines, but I ended up with this error: error: 'EthernetClass Ethernet' redeclared as different kind of symbol I don't understand what's wrong with the code or what I should change. Can someone help me with

Sending IR signal from Arduino to F&D speakers

梦想与她 提交于 2019-12-13 07:16:27
问题 I am using below code to send an IR signal to my speaker but they don't respond. #include <IRremote.h> IRsend irsend; const int buttonPin = 8; // the number of the pushbutton pin //const int ledPin = 3; int buttonState = 0; // variable for reading the pushbutton status void setup() { // pinMode(ledPin, OUTPUT); // initialize the pushbutton pin as an input: pinMode(buttonPin, INPUT); Serial.begin(9600); } void loop() { buttonState = digitalRead(buttonPin); // check if the pushbutton is pressed

cannot jump into arduino boot loader

怎甘沉沦 提交于 2019-12-13 07:08:14
问题 I want to jump from my application to the bootloader ( I load via bluetooth and have an application command to jump to the boot loader). the following work : void* bl = (void *) 0x3c00; goto *bl; or asm volatile { jmp BOOTL ::} asm volatile { .org 0x3c00 BOOTL: } (but code size grows to 0x3c00) BUT, the most obvious option asm volatile { jmp 0x3c00 ::} does not (seems it does not even produce code } Any idea why ? 回答1: The question as stated is not clear, as to what is working and what is

Arduino clean LCD Shield with color codes?

我只是一个虾纸丫 提交于 2019-12-13 07:07:51
问题 I thought it would be nice if I could set the background of the LCD Shield with an color code. I found out, that I just need to say lcd.clean(0xANYCOLOR) But is there another way? Maybe a better way? :P Code atm: #include <SparkFunColorLCDShield.h> LCDShield lcd; void setup() { lcd.init(EPSON); lcd.contrast(40); lcd.clear(0x0000FF); } void loop() { } 来源: https://stackoverflow.com/questions/41952838/arduino-clean-lcd-shield-with-color-codes