hello everyone, i have a such question: when i am connection my RFID reader to arduino, i am reading this :ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ can anyone tell me why? thx
hello everyone, i have a such question: when i am connection my RFID reader to arduino, i am reading this :ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ can anyone tell me why? thx
please post your sketch so we can review your code, it looks like it may be in there
Thanks
Peter
hello, i have one more problem i have two programs that i want to combine one is : an rfid reader followed by a PIN (from a matrix keypad) another is GPS receiver. These two programs are working separately. this first program is:
#include <Keypad.h>
#include <SoftwareSerial.h>
SoftwareSerial RFID(12, 13);
String tag;
int LED=9;
void setup()
{
//pinMode(8, OUTPUT);
//pinMode(9, OUTPUT);
//digitalWrite(8, LOW);
//digitalWrite(9, HIGH);
Serial.begin(9600);
RFID.begin(9600);
pinMode(LED,OUTPUT);
}
char c;
void loop(){
while(RFID.available()>0){
c=RFID.read();
tag += c;
}
tag=tag.substring(0,13);
while(tag.length()>0){
//Serial.print("ID: ");
Serial.println(tag);
tag="";
delay(200);
tag="";
}
delay(200);
tag="";
joseph_keypad();
}
void joseph_keypad()
{
const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns
// Define the Keymap
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = { 5, 4, 3, 2 };
byte colPins[COLS] = { 8, 7, 6, A0 };
// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
char key = keypad.getKey();
if (key != NO_KEY){
Serial.println(key);
if(key =='#')
{
digitalWrite(LED,1);
delay(500);
digitalWrite(LED,0);
delay(500);
}
else
{
digitalWrite(LED,1);
delay(100);
digitalWrite(LED,0);
delay(100);
}
}
}
second program is :
#include <SoftwareSerial.h>
#include <TinyGPS.h>
#define RXPIN 10
#define TXPIN 11
#define TERMBAUD 9600
#define GPSBAUD 9600
TinyGPS gps;
SoftwareSerial uart_gps(RXPIN, TXPIN);
void getgps(TinyGPS &gps);
void setup()
{
// Sets baud rate of your terminal program
Serial.begin(TERMBAUD);
// Sets baud rate of your GPS
uart_gps.begin(GPSBAUD);
Serial.println("");
Serial.println("GPS Shield QuickStart Example Sketch v12");
Serial.println(" ...waiting for lock... ");
Serial.println("");
}
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)
{
float latitude, longitude;
// Then call this function
gps.f_get_position(&latitude, &longitude);
Serial.print("Lat/Long: ");
Serial.print(latitude,5);
Serial.print(", ");
Serial.println(longitude,5);
int year;
byte month, day, hour, minute, second, hundredths;
gps.crack_datetime(&year,&month,&day,&hour,&minute,&second,&hundredths);
// Print data and time
Serial.print("Date: "); Serial.print(month, DEC); Serial.print("/");
Serial.print(day, DEC); Serial.print("/"); Serial.print(year);
Serial.print(" Time: "); Serial.print(hour, DEC); Serial.print(":");
Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC);
Serial.print("."); Serial.println(hundredths, DEC);
//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
Serial.print("Altitude (meters): "); Serial.println(gps.f_altitude());
// Same goes for course
Serial.print("Course (degrees): "); Serial.println(gps.f_course());
// And same goes for speed
Serial.print("Speed(kmph): "); Serial.println(gps.f_speed_kmph());
//Serial.println();
// Here you can print statistics on the sentences.
unsigned long chars;
unsigned short sentences, failed_checksum;
gps.stats(&chars, &sentences, &failed_checksum);
Serial.print("Satellites: ");
Serial.println(gps.satellites());
}
please help me if possible..
joseph
hello, i have one more problem i have two programs that i want to combine one is : an rfid reader followed by a PIN (from a matrix keypad) another is GPS receiver. These two programs are working separately. this first program is:
#include <Keypad.h>
#include <SoftwareSerial.h>
SoftwareSerial RFID(12, 13);
String tag;
int LED=9;
void setup()
{
//pinMode(8, OUTPUT);
//pinMode(9, OUTPUT);
//digitalWrite(8, LOW);
//digitalWrite(9, HIGH);
Serial.begin(9600);
RFID.begin(9600);
pinMode(LED,OUTPUT);
}
char c;
void loop(){
while(RFID.available()>0){
c=RFID.read();
tag += c;
}
tag=tag.substring(0,13);
while(tag.length()>0){
//Serial.print("ID: ");
Serial.println(tag);
tag="";
delay(200);
tag="";
}
delay(200);
tag="";
joseph_keypad();
}
void joseph_keypad()
{
const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns
// Define the Keymap
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = { 5, 4, 3, 2 };
byte colPins[COLS] = { 8, 7, 6, A0 };
// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
char key = keypad.getKey();
if (key != NO_KEY){
Serial.println(key);
if(key =='#')
{
digitalWrite(LED,1);
delay(500);
digitalWrite(LED,0);
delay(500);
}
else
{
digitalWrite(LED,1);
delay(100);
digitalWrite(LED,0);
delay(100);
}
}
}
second program is :
#include <SoftwareSerial.h>
#include <TinyGPS.h>
#define RXPIN 10
#define TXPIN 11
#define TERMBAUD 9600
#define GPSBAUD 9600
TinyGPS gps;
SoftwareSerial uart_gps(RXPIN, TXPIN);
void getgps(TinyGPS &gps);
void setup()
{
// Sets baud rate of your terminal program
Serial.begin(TERMBAUD);
// Sets baud rate of your GPS
uart_gps.begin(GPSBAUD);
Serial.println("");
Serial.println("GPS Shield QuickStart Example Sketch v12");
Serial.println(" ...waiting for lock... ");
Serial.println("");
}
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)
{
float latitude, longitude;
// Then call this function
gps.f_get_position(&latitude, &longitude);
Serial.print("Lat/Long: ");
Serial.print(latitude,5);
Serial.print(", ");
Serial.println(longitude,5);
int year;
byte month, day, hour, minute, second, hundredths;
gps.crack_datetime(&year,&month,&day,&hour,&minute,&second,&hundredths);
// Print data and time
Serial.print("Date: "); Serial.print(month, DEC); Serial.print("/");
Serial.print(day, DEC); Serial.print("/"); Serial.print(year);
Serial.print(" Time: "); Serial.print(hour, DEC); Serial.print(":");
Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC);
Serial.print("."); Serial.println(hundredths, DEC);
//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
Serial.print("Altitude (meters): "); Serial.println(gps.f_altitude());
// Same goes for course
Serial.print("Course (degrees): "); Serial.println(gps.f_course());
// And same goes for speed
Serial.print("Speed(kmph): "); Serial.println(gps.f_speed_kmph());
//Serial.println();
// Here you can print statistics on the sentences.
unsigned long chars;
unsigned short sentences, failed_checksum;
gps.stats(&chars, &sentences, &failed_checksum);
Serial.print("Satellites: ");
Serial.println(gps.satellites());
}
please help me if possible..
joseph