Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Re: Problem of interfacing analog accelerometer to "RESET" in Arduino UNO on: February 25, 2013, 09:37:33 am
Quote
I put a jumper wire in the analog pin_2 and it is connected into RESET...
You can do this but it will not work.

Simply connect the arduino pin to the reset pin of your device and toggle it. Do not mess with the arduino reset pin unless you know what you are doing which in your case you don't.

can you tell me on how to toggle??? what you mean by toggle?? turn on and off???
2  Using Arduino / Project Guidance / Re: Problem of interfacing analog accelerometer to "RESET" in Arduino UNO on: February 25, 2013, 09:07:56 am
@ Mike

just like of example in Arduino "Button"???

3  Using Arduino / Project Guidance / Problem of interfacing analog accelerometer to "RESET" in Arduino UNO on: February 25, 2013, 08:53:41 am
I want to reset the analog accelerometer in order to go back to its normal mode operation or in its function...

I know that there is a reset connection in my microcontroller Arduino UNO... I put a jumper wire in the analog pin_2 and it is connected into RESET...

my problem is I did'nt get the correct way of coding... I want to reset it but it did'nt... I want to program the "reset" instead of using pushbutton reset in Arduino UNO...

Is it possible to make this program??? please give me a hint or idea on how to do it....


Code:
const int buttonPin = A1;    // analog input pin 1
const int groundpin = 18;    // analog input pin 4 -- ground
const int powerpin = 19;     // analog input pin 5 -- voltage
int xpin = A3;                   // x-axis of the accelerometer
int sensorValue = 0;           // variable to store the value coming from the sensor

void setup()
{

  Serial.begin(9600);
 
  pinMode(buttonPin, INPUT);     
  pinMode(groundpin, OUTPUT);
  pinMode(powerpin, OUTPUT);
  digitalWrite(groundpin, LOW);
  digitalWrite(powerpin, HIGH);
}

void loop()
{
  sensorValue = digitalRead(A1);
 
    if (sensorValue == HIGH){     
       sensorValue = analogRead(xpin);   
       Serial.print(analogRead(xpin));
       Serial.print("\t");
       Serial.println();
    }
 
    else{
       if (sensorValue == LOW){
          analogWrite(A5, LOW);
       }
       
       else{
         if (sensorValue == HIGH){
            analogWrite(A2, LOW);
         }
         
         else{
            analogWrite(A2, HIGH);
         }
       }
    }
   
   
  delay(500);
}
4  Using Arduino / Project Guidance / need help for enabling/disabling accelerometer using RF module on: February 14, 2013, 01:20:18 am
is it possible to enable/disable the function of accelerometer using RF module???

can anyone tell me on how to make it...
5  Using Arduino / Programming Questions / Re: how to convert or read the GPS coordinates??? on: February 10, 2013, 08:25:05 am
@ Jack...


Sorry for that.. I'm a newbie for this... thanks a lot...
6  Using Arduino / Programming Questions / how to convert or read the GPS coordinates??? on: February 10, 2013, 07:57:43 am
please tell me on how to convert this data:

my data in longitude:12350.790066 and latitude:808.882390

and this is the code taken from the net...


#include "SIM900.h"
#include <SoftwareSerial.h>
#include "gps.h"

GPSGSM gps;

char lon[15];
char lat[15];
char alt[15];
char time[20];
char vel[15];
char msg1[5];
char msg2[5];

char stat;
char inSerial[20];
int i=0;
boolean started=false;

void setup()
{
  //Serial connection.
  Serial.begin(9600);
  Serial.println("GSM Shield testing.");
  if (gsm.begin(2400)){
    Serial.println("\nstatus=READY");
    gsm.forceON();   //To ensure that SIM908 is not only in charge mode
    started=true; 
  }
  else Serial.println("\nstatus=IDLE");
 
  if(started){
    //GPS attach
    if (gps.attachGPS())
      Serial.println("status=GPSREADY");
    else Serial.println("status=ERROR");
   
    delay(20000);   //Time for fixing
    stat=gps.getStat();
   if(stat==1)
      Serial.println("NOT FIXED");
   else if(stat==0)
      Serial.println("GPS OFF");
   else if(stat==2)
      Serial.println("2D FIXED");
   else if(stat==3)
      Serial.println("3D FIXED");
   delay(5000);
   //Get data from GPS
   gps.getPar(lon,lat,alt,time,vel);
   Serial.println(lon);
   Serial.println(lat);
   Serial.println(alt);
   Serial.println(time);
   Serial.println(vel);
  }
};

void loop()
{
  //Read for new byte on serial hardware,
  //and write them on NewSoftSerial.
  serialhwread();
  //Read for new byte on NewSoftSerial.
  serialswread();
};

void serialhwread(){
  i=0;
  if (Serial.available() > 0){           
    while (Serial.available() > 0) {
      inSerial=(Serial.read());
      delay(10);
      i++;     
    }
   
    inSerial='\0';
    if(!strcmp(inSerial,"/END")){
      Serial.println("_");
      inSerial[0]=0x1a;
      inSerial[1]='\0';
      gsm.SimpleWriteln(inSerial);
    }
    //Send a saved AT command using serial port.
    if(!strcmp(inSerial,"TEST")){
        stat=gps.getStat();
   if(stat==1)
      Serial.println("NOT FIXED");
   else if(stat==0)
      Serial.println("GPS OFF");
   else if(stat==2)
      Serial.println("2D FIXED");
   else if(stat==3)
      Serial.println("3D FIXED");
    }
    //Read last message saved.
    if(!strcmp(inSerial,"MSG")){
      Serial.println(msg1);
    }
    else{
      Serial.println(inSerial);
      gsm.SimpleWriteln(inSerial);
    }   
    inSerial[0]='\0';
  }
}

void serialswread(){
  gsm.SimpleRead();
}
7  Using Arduino / Project Guidance / Need help on how to convert/read the GPS Coordinates... on: February 10, 2013, 07:28:30 am
please tell me on how to convert this data:

my data in longitude:12350.790066 and latitude:808.882390

and this is the code taken from the net...


#include "SIM900.h"
#include <SoftwareSerial.h>
#include "gps.h"

GPSGSM gps;

char lon[15];
char lat[15];
char alt[15];
char time[20];
char vel[15];
char msg1[5];
char msg2[5];

char stat;
char inSerial[20];
int i=0;
boolean started=false;

void setup()
{
  //Serial connection.
  Serial.begin(9600);
  Serial.println("GSM Shield testing.");
  if (gsm.begin(2400)){
    Serial.println("\nstatus=READY");
    gsm.forceON();   //To ensure that SIM908 is not only in charge mode
    started=true; 
  }
  else Serial.println("\nstatus=IDLE");
 
  if(started){
    //GPS attach
    if (gps.attachGPS())
      Serial.println("status=GPSREADY");
    else Serial.println("status=ERROR");
   
    delay(20000);   //Time for fixing
    stat=gps.getStat();
   if(stat==1)
      Serial.println("NOT FIXED");
   else if(stat==0)
      Serial.println("GPS OFF");
   else if(stat==2)
      Serial.println("2D FIXED");
   else if(stat==3)
      Serial.println("3D FIXED");
   delay(5000);
   //Get data from GPS
   gps.getPar(lon,lat,alt,time,vel);
   Serial.println(lon);
   Serial.println(lat);
   Serial.println(alt);
   Serial.println(time);
   Serial.println(vel);
  }
};

void loop()
{
  //Read for new byte on serial hardware,
  //and write them on NewSoftSerial.
  serialhwread();
  //Read for new byte on NewSoftSerial.
  serialswread();
};

void serialhwread(){
  i=0;
  if (Serial.available() > 0){           
    while (Serial.available() > 0) {
      inSerial=(Serial.read());
      delay(10);
      i++;     
    }
   
    inSerial='\0';
    if(!strcmp(inSerial,"/END")){
      Serial.println("_");
      inSerial[0]=0x1a;
      inSerial[1]='\0';
      gsm.SimpleWriteln(inSerial);
    }
    //Send a saved AT command using serial port.
    if(!strcmp(inSerial,"TEST")){
        stat=gps.getStat();
   if(stat==1)
      Serial.println("NOT FIXED");
   else if(stat==0)
      Serial.println("GPS OFF");
   else if(stat==2)
      Serial.println("2D FIXED");
   else if(stat==3)
      Serial.println("3D FIXED");
    }
    //Read last message saved.
    if(!strcmp(inSerial,"MSG")){
      Serial.println(msg1);
    }
    else{
      Serial.println(inSerial);
      gsm.SimpleWriteln(inSerial);
    }   
    inSerial[0]='\0';
  }
}

void serialswread(){
  gsm.SimpleRead();
}
8  Using Arduino / Project Guidance / Re: Disabling the accelerometer on: February 07, 2013, 09:13:11 pm
To mark:

yes it is... i want to communicate the RF module to the Accelerometer... what can i do to make it???

9  Using Arduino / Project Guidance / Re: Disabling the accelerometer on: February 07, 2013, 07:02:55 am
to Mark:

I am using right now an RF module... If I press the button of the remote of the RF MODULE which is "ON", I want to disable the function of the accelerometer... when it is turn off, I want to go back in normal the function of the accelerometer... just make an on and off to the accelerometer...
10  Using Arduino / Project Guidance / Disabling the accelerometer on: February 07, 2013, 03:55:41 am
i want to disable the function of the accelerometer if I put an LED in A2 (analog output for Arduino Uno) which is in high condition... if it is low condition, the function of the accelerometer can function it back normally.. during high state i want the accelerometer to disable...
my problem is how to make a command to disable the function of the accelerometer... Is it possible to use an IF/ELSE statement here...
can anyone help me??? please...

this is the code for my accelerometer taken from the net...

Code:
const int groundpin = 18;             // analog input pin 4 -- ground
const int powerpin = 19;              // analog input pin 5 -- voltage
int xpin = A3;                            // x-axis of the accelerometer
int sensorValue = 0;                    // variable to store the value coming from the sensor

void setup()
{
  // initialize the serial communications:
  Serial.begin(9600);

  pinMode(groundpin, OUTPUT);
  pinMode(powerpin, OUTPUT);
  digitalWrite(groundpin, LOW);
  digitalWrite(powerpin, HIGH);
}

void loop()
{
  
  // read the value from the sensor:
  sensorValue = analogRead(xpin);    
  
  // print the sensor values:
  Serial.print(analogRead(xpin));
  // print a tab between values:
  Serial.print("\t");
  Serial.println();
  // delay before next reading:
  delay(100);
}


Moderator edit: [code] [/code] tags added.
11  Using Arduino / Project Guidance / Re: high and low output (LED) on: February 06, 2013, 11:14:43 am
oh yeah... i try.. thanks for that....
12  Using Arduino / Project Guidance / Re: How to know if a Arduino has enough memory for a project on: February 06, 2013, 11:07:54 am
in order to save memory... make the function compress...
13  Using Arduino / Project Guidance / high and low output (LED) on: February 06, 2013, 11:02:02 am
My problem is when the LED is "High" or "On", I want the code(inside) to be disable... e.g. accelerometer code... I want to put an LED on it when it is turn on, the accelerometer will not be function...
 
and when the LED is "Low" or "Off", I want it to go back or enable...

Can anyone willing to help me to teach what is the command fit for it....


this is my email address: rowell_regis19@lsu.edu.ph
14  International / Portugues / [Ajuda] Ler pico de tensão e contar tempo de pico on: January 08, 2013, 08:20:31 am
Qual a melhor maneira de implementar uma função para contar o tempo de duração deste sinal,
do momento que há o primeiro pico, ao momento que começa a baixar (cerca de 5s no caso)?


A precisão/resolução pode ser de cerca de 100ms.

Eu implementei uma função baseada na média das 3 últimas leituras + uma,
quando a diferença entre a media e a última é maior que x, ele entende que a tensão começou a cair.

Funcionou bem em testes, porém ao montar no circuito completo aparecem muitos transientes (como podem ver),
e precisarei conviver com eles =/

Alguma ideia?

15  International / Portugues / Re: [Ajuda] Problema ao ligar arduino no carro com bateria 12v, LCD 16x2 fica maluco on: January 08, 2013, 08:08:56 am
Quote
...descobri que se a inicializaçao do LCD que é feita no arranque  normalmente na funçao setup(), falhar  depois quando vai para a loop ele nao imprime corretamente no LCD...

Sim, isto acontece muito, principalmente quando a alimentação é ruim. E pode tentar forçar um inicialização de novo no loop que não adianta, tem que resetar o bicho diversas vezes até funcionar...
Pages: [1]