Profile

Cover photo
Rovie Anne Tan
Works at Texas Instruments
Attended Bulcan State University
Lived in Baguio City, Philippines
166 followers|87,130 views
AboutPostsPhotosYouTube

Stream

Rovie Anne Tan

Shared publicly  - 
 
3,800+ emails accumulated in weekend???? waaaaaahhhhhh!!!!
1
Sheryll Lopez's profile photoRovie Anne Tan's profile photoWyrlo Albert's profile photoChanda Nacua's profile photo
13 comments
 
+5 !! wala kasing ibang choice other than +1...ahihihihi :P
Add a comment...

Rovie Anne Tan

Shared publicly  - 
 
welcome google+ ahahaha... nice parang FB!
1
Rovie Anne Tan's profile photoED Carty's profile photo
3 comments
 
Rovie, I need help with my code. Maybe someone there can help me sort it out. I am trying t add a SD card, But cant seem to get the construct of the variables correct. (at the end of the code its all // remed out) Thanks

// VIPER 37 Altimeter, Accelerometer, temp, Blue LCD,
// Mega 2560 V3
// LCD = I2C
// Temp = pin 2
// Accel = X=A0, Y=A1, Z=A3. Always awake, Always 5v, Always Low
// Altimeter = MS5607, RevA, Parallax, I2C
#include <Wire.h> //Alimeter ?
#include "IntersemaBaro.h" //Altimeter
#include <dht11.h> //Blue Temp sensor
#include <SoftwareSerial.h>
#include <TinyGPS.h>
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <AcceleroMMA7361.h> //Accelerometer
#include <SD.h>

// On the Ethernet Shield, CS is pin 4. Note that even if it's not
// used as the CS pin, the hardware CS pin (10 on most Arduino boards,
// 53 on the Mega) must be left as an output or the SD library
// functions will not work.
const int chipSelect = 53;

dht11 DHT11;

// Define which pins you will use on the Arduino to communicate with your 
// GPS. In this case, the GPS module's TX pin will connect to the 
// Arduino's RXPIN which is pin 3.
#define RXPIN 50
#define TXPIN 52
//Set this value equal to the baud rate of your GPS
#define GPSBAUD 4800
Intersema::BaroPressure_MS5607B baro(true);

#define I2C_ADDR 0x3F // Define I2C Address where the SainSmart LCD is
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7

LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
AcceleroMMA7361 accelero;
int x;
int y;
int z;

// Create an instance of the TinyGPS object
TinyGPS gps;
// Initialize the NewSoftSerial library to the pins you defined above
SoftwareSerial uart_gps(RXPIN, TXPIN);

// This is where you declare prototypes for the functions that will be 
// using the TinyGPS library.
void getgps(TinyGPS &gps);

// In the setup function, you need to initialize two serial ports; the 
// standard hardware serial port (Serial()) to communicate with your 
// terminal program an another serial port (NewSoftSerial()) for your 
// GPS.
void setup()
{
  DHT11.attach(2);
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  Serial.print("Initializing SD card...");
  // make sure that the default chip select pin is set to
  // output, even if you don't use it:
  pinMode(10, OUTPUT);
  
  // see if the card is present and can be initialized:
  if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
    return;
  }
  Serial.println("card initialized.");
  lcd.clear();
  lcd.begin (20,4);

// Switch on the backlight
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);

// Position cursor and write some text
lcd.home (); // go to the first line, first character
    Serial.begin(9600);
    baro.init();
  accelero.begin(13, 12, 11, 10, A0, A1, A2);
  accelero.setARefVoltage(5);                   //sets the AREF voltage to 5V
  accelero.setSensitivity(LOW);               //sets the sensitivity to +/-1.5G
  accelero.calibrate();
  delay(500);

  // This is the serial rate for your terminal program. It must be this 
  // fast because we need to print everything before a new sentence 
  // comes in. If you slow it down, the messages might not be valid and 
  // you will likely get checksum errors.
  //Serial.begin(115200);
  //Sets baud rate of your GPS
  uart_gps.begin(GPSBAUD);
  lcd.home();
  lcd.print("VIPER 37 GPS Program");
  lcd.setCursor ( 0, 1 );
  lcd.print("waiting for lock");
  delay (3000);
  lcd.setCursor ( 0, 2 );
  lcd.print("Still Waiting");
  delay (3000);
  lcd.setCursor (0, 3);
  lcd.print("Get some Coffee..");
 //lcd.setBacklight(LOW);
}

// This is the main loop of the code. All it does is check for data on 
// the RX pin of the ardiuno, makes sure the data is valid NMEA sentences, 
// then jumps to the getgps() function.
void loop()
{
  while(uart_gps.available())     // While there is data on the RX pin...
  {
      int c = uart_gps.read();    // load the data into a variable...
      if(gps.encode(c))      // if there is a new valid sentence...
      {
        getgps(gps);         // then grab the data.
      }
  }
}


// The getgps function will get and print the values we want.
void getgps(TinyGPS &gps)
{
  // To get all of the data into varialbes that you can use in your code, 
  // all you need to do is define variables and query the object for the 
  // data. To see the complete list of functions see keywords.txt file in 
  // the TinyGPS and NewSoftSerial libs.
  
  // Define the variables that will be used
  float latitude, longitude;
  // Then call this function
  gps.f_get_position(&latitude, &longitude);
  // You can now print variables latitude and longitude
  lcd.setBacklight(HIGH);
  lcd.clear();
  lcd.home();
  lcd.print("Lat: "); 
  lcd.print(latitude,5); 
  lcd.setCursor ( 0, 1 ); // go to the 2nd line
  lcd.print("Long: "); 
  lcd.println(longitude,5);
  
  // Same goes for date and time
  int year;
  byte month, day, hour, minute, second, hundredths;
  gps.crack_datetime(&year,&month,&day,&hour,&minute,&second,&hundredths);
  // Print data and time
 //lcd.print("Date: "); lcd.print(month, DEC); lcd.print("/"); 
 // lcd.print(day, DEC); lcd.print("/"); lcd.print(year);
  lcd.setCursor ( 0, 3 );
  lcd.print("  Time: "); lcd.print(hour-5, DEC); lcd.print(":"); 
  lcd.print(minute, DEC); lcd.print(":"); lcd.print(second, DEC); 
 /* lcd.print("."); lcd.println(hundredths, DEC);
  lcd.setCursor ( 0, 3 );
  //Since month, day, hour, minute, second, and hundr
  */
  // Here you can print the altitude and course values directly since 
  // there is only one value for the function
  lcd.setCursor ( 0, 2 ); // go to the 2nd line
  lcd.print("Alt (m): "); lcd.println(gps.f_altitude());  
  delay(3000); // Make GPS data readable
  // Same goes for course
 // lcd.print("Course (degrees): "); lcd.println(gps.f_course()); 
  // And same goes for speed
//  lcd.print("Speed(kmph): "); lcd.println(gps.f_speed_kmph());
//  lcd.println();
  
  // Here you can print statistics on the sentences.
 // unsigned long chars;
 // unsigned short sentences, failed_checksum;
//  gps.stats(&chars, &sentences, &failed_checksum);
//  lcd.print("Failed Checksums: ");lcd.print(failed_checksum);
//  lcd.println(); lcd.println();
 lcd.clear();
  lcd.home ();
  int alt = baro.getHeightCentiMeters();
  lcd.print ("     Feet:");
  lcd.setCursor ( 0, 1 ); 
   lcd.println((float)(alt) / 30.48);
   Serial.println("\n");

  int chk = DHT11.read();
  lcd.setCursor ( 0, 2 );
  lcd.print("Read sensor:");
  switch (chk)
  
  {
    case 0: lcd.println("OK"); break;
    case -1: lcd.println("Checksum error"); break;
    case -2: lcd.println("Time out error"); break;
    default: lcd.println("Unknown error"); break;
  }
  
  lcd.setCursor ( 0, 3 );
  lcd.print("Humidity (%): ");
  lcd.println((float)DHT11.humidity,(DEC,5));
  delay(1000); // time to read the first screen
      lcd.home ();
    lcd.clear();
   lcd.print("Temp(°F):");
  lcd.println(DHT11.fahrenheit(), (DEC,4));
  lcd.setCursor ( 0, 1);
  lcd.print("Dew Point (°C):");
   lcd.setCursor ( 0, 2 );
  lcd.println(DHT11.dewPoint(),(DEC,4));
  delay(1000);// time to read the second screen
    lcd.clear();
  lcd.home ();
    x = accelero.getXAccel();
  y = accelero.getYAccel();
  z = accelero.getZAccel();
  lcd.print("\nx: ");
  lcd.print(x/4);
  lcd.print(" \ty: ");
  lcd.print(y=(y+16)/4); // add 16 to Y, then div all by 4
  lcd.print(" \tz: ");
  lcd.print(z=(z+300)/4); // add 300 to y, then div all by 4
  delay(2000);                                     //make it readable
    }
  // make a string for assembling the data to log:
  String dataString = "";
  
  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  File dataFile = SD.open("datalog.txt", FILE_WRITE);

  // if the file is available, write to it:
 // if (dataFile) {
 //   dataFile.println(dataString);
  //  dataFile.close();
    // print to the serial port too:
    Serial.println(dataString);
  }  
  // if the file isn't open, pop up an error:
  else {
    Serial.println("error opening datalog.txt");
  } 
}
Add a comment...

Rovie Anne Tan

Shared publicly  - 
 
Super Happy Burrthday ate +Jane Bergonia!!! wish a wish your wish will come true!!!! love yah!!!! mwah mwah mwah!!!!
3
Chai Canlas's profile photoAmi Macaranas's profile photoChanda Nacua's profile photo
3 comments
 
happy birthday Jane !
Add a comment...
Story
Tagline
just pretty! bwahahaha!
Education
  • Bulcan State University
    BS ECE, 2001 - 2006
Basic Information
Gender
Female
Other names
Anne
Work
Occupation
Application developer
Employment
  • Texas Instruments
    Application Developer, 2007 - present
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Previously
Baguio City, Philippines
Links