From b8dc0f4d9f3b52d35f2ccdd2cec5599777ac0c3f Mon Sep 17 00:00:00 2001 From: Marcio Mangar Date: Thu, 10 Jan 2013 16:26:51 -0200 Subject: [PATCH] motion detection --- bluetooth/bluetooth/bluetooth.ino | 96 ++++++++++++++++++ ethernet/.DS_Store | Bin 0 -> 6148 bytes .../motion_detection/motion_detection.ino | 23 +++++ temp/.DS_Store | Bin 0 -> 6148 bytes 4 files changed, 119 insertions(+) create mode 100644 bluetooth/bluetooth/bluetooth.ino create mode 100644 ethernet/.DS_Store create mode 100644 motion_detection/motion_detection/motion_detection.ino create mode 100644 temp/.DS_Store diff --git a/bluetooth/bluetooth/bluetooth.ino b/bluetooth/bluetooth/bluetooth.ino new file mode 100644 index 0000000..f5bb264 --- /dev/null +++ b/bluetooth/bluetooth/bluetooth.ino @@ -0,0 +1,96 @@ +/* FILE: ARD_BLUETOOTH_SERIAL_MODULE_HCARDU0004_Example.pde + DATE: 17/07/12 + VERSION: 0.2 + + REVISIONS: + + 27/08/12> V0.2 updated software serial functions as these are now included + with V1.0 of the Arduino development environment. + +This is a simple example of how to use the HobbyComponents Bluetooth serial +module (HCARDU0004). This module allows communication from an Arduino dev +board to a Bluetooth enabled device. The module communicates with an Arduino +device via a simple two wire serial protocol. If you choose to use the modules +default settings then the module requires no setting up to communicate with it, +just connect to the Arduino. The device defaults to 9600 baud, 8 data bits, +and 1 stop bit. The baud rate, amongst other settings can be changed using +standard AT commands via its serial interface. + +This sketch demonstrates an example of how to communicate with the +device using a software serial interface using just two DIO lines to interface +with the module. The program will pass-through for any data sent to and from +the device to the Arduino's hardware serial interface. This will allow you to +communicate with any device paired with the module via Arduino IDE's built in +serial port monitor. + + +SENSOR PINOUT: + +PIN 1: KEY +PIN 2: VCC +PIN 3: GND +PIN 4: TXD +PIN 5: RXD + + +SETUP INSTRUCTIONS: + +Connect the Bluetooth module as follows: + +Arduino Bluetooth module +5V PIN 2 (VCC), +GND PIN 3 (GND) +DIO 10 PIN 4 (TXD) +DIO 11 PIN 5 (RXD) + +Compile the sketch and upload to your Arduino. + +Pair your Bluetooth enabled device with the Bluetooth module using PASSCODE: 1234 +(you do not need to do anything on the module side to do this). + +Open up the serial port monitor in the Arduino IDE (CTRL+SHIF+M). + +You will now be able to communicate with the paired Bluetooth device. + + +You may copy, alter and reuse this code in any way you like but please leave +reference to HobbyComponents.com in your comments if you redistribute this code. +THIS CODE MAY NOT BE USED IN ANY FORM BY OTHER EBAY SELLERS.*/ + + + +/* Include the software serial port library */ +#include + +/* DIO used to communicate with the Bluetooth module's TXD pin */ +#define BT_SERIAL_TX_DIO 10 +/* DIO used to communicate with the Bluetooth module's RXD pin */ +#define BT_SERIAL_RX_DIO 11 + +/* Initialise the software serial port */ +SoftwareSerial BluetoothSerial(BT_SERIAL_TX_DIO, BT_SERIAL_RX_DIO); + +void setup() +{ + /* Set the baud rate for the hardware serial port */ + Serial.begin(9600); + /* Set the baud rate for the software serial port */ + BluetoothSerial.begin(9600); + +} + +/* Main loop that will pass any data to and from the Bluetooth mode to the + host PC */ +void loop() +{ + /* If data is available from the Bluetooth module then pass it on to the + hardware serial port. */ + if (BluetoothSerial.available()) + Serial.write(BluetoothSerial.read()); + + /* If data is available from the hardware serial port then pass it on + to the Bluetooth module. */ + if (Serial.available()) + BluetoothSerial.write(Serial.read()); +} + diff --git a/ethernet/.DS_Store b/ethernet/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0CKNU$`eNhwmJ!9V1`(ZA!& z?pmzoETS_o`_0Z{A0K2l3jo5M1vWqx04!8OK}La)yD(HT$pR4-$GC+M1`uGI77X+o zU9|RHNZ<~JxaQC6x4~9>i7+~W5qNO#&y$HiihZnk@h77wNgItV)yU69q%xn_eqB_0n15dQ%m-^wJO`%I?PT2<^Vf?nOZw4yv`q!nTj= z^5itD%Y}V-)T+y7vz29=DAhM>Z~x%zqU$|mk59SgR?v1xb~G&8=cUC4Gr$Zm1I)m` zXTV$**4Dpgf(c*-n1Qbh(D@)y2_1vEMs;*xqn-eW6?7{>o8A&sBMmwRbB!255xNvn zmkRU55V{=w(&RY?bB($jgqj)0F*AQWUWA$*{Zgfaa5Qqu3@`($43u@ZO85UcelmrR z{M8cfF$2uNA7emN+MTwGn=*Inx9!ngD^YJyNhmKT0|o7sp8)L8IZ{(W9hYQdo?|fA VNTZNnl_T