arduino

Command line Arduino compiling and uploading?

家住魔仙堡 提交于 2020-01-19 23:55:21
问题 How do I compile and upload Arduino sketches from the command line on Mac and Linux? I've installed the Arduino programming environment. Are there some sample makefiles anywhere? 回答1: Compiling and uploading sketches (as apposed to C/C++ sources) on the command line (on Windows, Mac, and Linux) is supported directly via flags to the arduino executable since 1.5.0. An ino can be compiled and uploaded with arduino --upload [sketch.ino] Documentation 回答2: There is a command-line Arduino toolkit

Arduino安全和警报系统项目

半城伤御伤魂 提交于 2020-01-17 22:29:46
在这个项目中,我们将学习如何制作一个Arduino安全和警报系统。您可以观看以下视频或阅读下面的书面教程。 Arduino安全和警报系统项目 概述 按下A按钮后10秒内将激活警报。 为了检测物体,它使用了超声波传感器,一旦警报器检测到某种东西,蜂鸣器就会开始发出声音。 为了停止警报,我们需要输入4位数字的密码。 预设密码是1234,但我们也可以更改它。 通过按B按钮,我们进入密码更改菜单,首先我们需要输入当前密码以继续,然后输入新的4位数字密码。 更改密码后,下次启动警报时,我们只能通过输入新密码来停止警报。 如果输入了错误的密码,我们将收到一条消息,需要再次尝试。 所需组件 现在,让我们看看该项目所需的组件。显然,我们需要一个Arduino板,一个超声波传感器,一个LCD显示器,一个蜂鸣器和一个4×4键盘。 电路原理图 这是电路原理图。 图略 因此,对于蜂鸣器,我们只需要一个引脚即可,但需要一个PWM引脚。 4×4键盘有8个引脚,其中4个用于行,而4个用于列。 每个按钮实际上都是一个按钮开关,按下该按钮可使行和列之间短路。 因此,例如,如果我们将第1行的行设置为低,而将所有列的行设置为高,则当我们按下按钮3时,由于两行之间的短路,第3列的行将降为低 在这种情况下,我们可以注册按钮3已被按下。 至于该项目的其他两个组件,即超声波传感器和LCD显示屏

Arduino学习笔记 (五) -- 红外接收与解码

夙愿已清 提交于 2020-01-17 16:53:03
实验原料:   1、PC一台   2、Arduino UNO R3 + type-b数据线   3、红外遥控 + 红外接收模块   4、发光led二极管   5、杜邦线若干   6、电阻(用作限流 100R ~ 1K) 模块连接:   红外接收器的signal接在数字引脚11上   GND接控制板的GND   VCC接控制板上+5V   发光二极管正极引脚接在数字引脚4上,   LED负极通过220欧姆电阻回到控制板的GND 效果:   红外遥控器按下按键时,电脑的串口监视器显示按键编码   若按下数字键1,则LED点亮   若按下数字键2,则LED熄灭 下面上代码 #include <IRremote.h> int RECV_PIN = 11;//定义红外接收器的引脚为11 int LED_PIN = 4; //定义发光LED引脚数字4 int a = 0; IRrecv irrecv(RECV_PIN); decode_results results; String jian[17] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "0", "#", "上", "左", "OK", "右", "下" }; String ma[17] = { "16753245", "16736925", "16769565",

Arduino void loop stops after a while

风流意气都作罢 提交于 2020-01-17 15:49:13
问题 /******************************************************************************************************* I am currently building an autonomous vehicle. What it does is as follows it draws GPS information and Magnetometer Sensor data. Then when all sensor data is collected, Arduino decides which way to turn. This is done by calculating a heading error. *******************************************************************************************************/ /*************************************

How to remove delay?

陌路散爱 提交于 2020-01-17 15:31:52
问题 I am working on a very important project that needs to have maximum efficiency and speed. Basically I use the serial ports of Arduino to communicate to a SIM900 GSM, but I think this can apply to any other device that is connected to the Serial port of Arduino. The problem is that after each command I send to the SIM900 I put a delay because I don't know how much time it will take to be executed, but sometimes commands can be executed really fast or really slow. My question is: How can I

Where does 'baud rate' value go in serial Android-2-Arduino communication over USB

孤街浪徒 提交于 2020-01-17 06:42:52
问题 Issues with Android-2-Arduino communication made it clear to me I have no clue which parts of the chain are (directly) affected by the baud rate. Could you please confirm/correct following assumptions? The 'baud rate' value is not related to anything on the Android side. Therefore it is not a bug when an Android USB/Serial library only sends the baud rate value (9600, 125000, etc.) to the other side via controlTransfer, not storing it anywhere, not setting it somehow to the Android device

Arduino Switch to Turn a Relay timer

∥☆過路亽.° 提交于 2020-01-17 05:07:36
问题 Briefly: I would like to turn on a relay for 30 seconds, after I toggle a switch on. I'm trying to do a blinds automation at home. I have a simple ON-OFF-ON switch, attached to an Arduino connected to Relays. I want to turn on Relay#1 for a maximum of 30 seconds if I toggle the switch down from center. In other words, relay turns on when I switch, and when timer reaches 30 seconds relay turns off. similarly I want to turn on Relay#2 for exactly 30 seconds if I toggle the switch up from center

Why am I getting the same performance from Hardware Serial and Software Serial?

北慕城南 提交于 2020-01-17 04:59:08
问题 I'm trying to interface (1) LinkSprite JPEG Color Camera TTL Interface - Infrared and (2) Arduino Mega 2560 connected to my laptop. While I am able to print the HEX values of the images, it takes about 30 seconds to print 1 image to the monitor. I thought that it was because I was using SoftwareSerial, so I tried HardwareSerial, but still, 30 seconds per image. Shouldn't it be faster using HardwareSerial? Just wondering, do I need a special cable connecting the arduino to my laptop? I tried

Cannot update sensor data in Python (Tkinter) from my arduino sensors

有些话、适合烂在心里 提交于 2020-01-17 04:30:08
问题 I am learning about interfaces on Python Tkinter. I was testing before sending random numbers from my arduino to my Python interface, It worked (It updates all the time), so I thought it was going to work when sending data from a sensor, but it did not. So, this is a test code, if I am pressing the button, I would have to send 3 variables with the number 1, and if I am not, I will get 2 variables with the number 2 and one random variable. So, I never get the values that I should get when

node-serialport only communicates with Arduino if another app has already connected to the port

蹲街弑〆低调 提交于 2020-01-17 01:39:06
问题 Running on node in OS X, I am trying to use node-serialport to talk to an Arduino. All communication to the Arduino works as expected when using Arduino IDE's Serial Monitor, or the OS X utility SerialTools. However, when just running my node app, node-serialport tells me the connection is successful, but I get no communication. If I first make a connection to the arduino with Arduino IDE's Serial Monitor or SerialPorts, then run my node app, the node app sends and receives data just fine