-
Prototype Development - 2
05/27/2016 at 16:55 • 0 commentsBridging the directions with the application using java codes and checking responses.
The baud rate of arduino uno is checked and used in the java code. the uart communication is established in the COM port to receive the data serially.
-
Prototype Development - 1
05/27/2016 at 16:49 • 0 commentsIn this stage the reading are linked together and they are checked for direction responses
Direction Response Left Gmail Top Cortana Right Close current Application -
::Building The Java Codes::
05/27/2016 at 16:46 • 0 commentsJava coding using the package RxTx has to be done. These packages are available open source and they are downloaded. The function of the library are checked through online and serial communication examples and they are built.
Basic serial communication code is run and check for any errors prones.
(The complete java code has not been linked)
-
:: Interfacing Accelerometer::
05/27/2016 at 16:45 • 0 commentsTo connect the accelerometer and receive the reading in the computer and calibrate correspondingly.
Arduino Code:
// In the below code 1 2 3 4 mention the directions respectively.
/* analog 0: accelerometer self test
analog 1: z-axis
analog 2: y-axis
analog 3: x-axis
analog 4: ground
analog 5: vcc
*/
const int groundpin = 18; // analog input pin 4 -- ground
const int powerpin = 19; // analog input pin 5 -- voltage
const int xpin = A3; // x-axis of the accelerometer
const int ypin = A2; // y-axis
const int zpin = A1; // z-axis (only on 3-axis models)
void setup()
{
// initialize the serial communications:
Serial.begin(9600);
// Provide ground and power by using the analog inputs as normal
// digital pins. This makes it possible to directly connect the
// breakout board to the Arduino. If you use the normal 5V and
// GND pins on the Arduino, you can remove these lines.
pinMode(groundpin, OUTPUT);
pinMode(powerpin, OUTPUT);
digitalWrite(groundpin, LOW);
digitalWrite(powerpin, HIGH);
}
void loop()
{
int x = analogRead(xpin)-350;
int y = analogRead(ypin)-350;
// Serial.print(x);
// Serial.print("\t");
// Serial.print(y);
// Serial.print("\t");
// Serial.print(analogRead(zpin)-350);
// Serial.println();
if(x>40)
{
// Serial.print("Left");
Serial.print("1");
Serial.println();
}
else if(x<-40)
{
//Serial.print("Right");
Serial.print("2");
Serial.println();
}
else if(y>50)
{
//Serial.print("Top");
Serial.print("3");
Serial.println();
}
else if(y<-50)
{
//Serial.print("Bottom");
Serial.print("4");
Serial.println();
}
delay(500);
}
-
Block Design
05/27/2016 at 16:23 • 0 commentsThe prototype model has been designed.