This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add the SPI library so we can communicate with the ADXL345 sensor | |
#include <SPI.h> | |
//Assign the Chip Select signal to pin 10. | |
int CS=10; | |
//This is a list of some of the registers available on the ADXL345. | |
//To learn more about these and the rest of the registers on the ADXL345, read the datasheet! | |
char POWER_CTL = 0x2D; //Power Control Register |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int sensor1 = A0; //connected to analog 0 | |
void setup() | |
{ | |
Serial.begin(9600); | |
} | |
void loop() {int sensor1pin = analogRead(sensor1); | |
Serial.print("sensor1:"); | |
Serial.println(sensor1pin); | |
delay(2000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int sensorDOPin = 2; // connect DO pin to pin 2 of Arduino | |
const int ledPin = 13; // the number of the LED pin | |
// variables will change: | |
int SensorState = 0; // variable for the state of the sensor | |
void setup() { | |
// initialize the LED pin as an output: | |
pinMode(ledPin, OUTPUT); | |
// initialize the sensor pin DO as input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int buzzer=8;// Set the control the buzzer digital IO pin | |
void setup() | |
{ | |
pinMode(buzzer,OUTPUT);// Setting the digital IO pin mode , OUTPUT is Wen out | |
} | |
void loop() | |
{ | |
unsigned char i,j;// Define the variable | |
while(1) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <MeetAndroid.h> | |
// declare MeetAndroid so that you can call functions with it | |
MeetAndroid meetAndroid; | |
int redLed = 9; | |
void setup() | |
{ | |
// use the baud rate your bluetooth module is configured to | |
// not all baud rates are working well, i.e. ATMEGA328 works best with 57600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* visit www.amarino-toolkit.net to know about Amarino*/ | |
#include <MeetAndroid.h> | |
// declare MeetAndroid so that you can call functions with it | |
MeetAndroid meetAndroid; | |
int redLed = 9; | |
void setup() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <MeetAndroid.h> | |
// declare MeetAndroid so that you can call functions with it | |
MeetAndroid meetAndroid; | |
int redLed = 9; | |
void setup() | |
{ | |
// use the baud rate your bluetooth module is configured to | |
// not all baud rates are working well, i.e. ATMEGA328 works best with 57600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <IRremote.h> | |
const int RECV_PIN = 7; | |
const int LED_PIN = 2; | |
const int light= 11; | |
IRrecv irrecv(RECV_PIN); | |
decode_results decodedSignal; //stores results from IR sensor | |
void setup() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <IRremote.h> | |
const int irReceiverPin = 7; | |
const int relayPin = 2; | |
const int ledPin = 11; | |
IRrecv irrecv(irReceiverPin); //create an IRrecv object | |
decode_results decodedSignal; //stores results from IR sensor | |
void setup() { | |
Serial.begin(9600); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
// Open serial communications: | |
Serial.begin(9600); | |
pinMode(2, OUTPUT); | |
// send an intro: | |
Serial.println("Enter a value"); | |
Serial.println(); | |
} |