Jump to content

Ebrahim

Members
  • Content Count

    5
  • Joined

  • Last visited

About Ebrahim

  • Rank
    Noob Class

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello @NurseBob , thanks for responding. I have followed the guide from here https://forum.43oh.com/topic/9360-bluetooth-module-hc-05/ and tried to do the same for the fingerprint scanner by using software serial for debugging purposes in order to use serial monitor and using hardwareserial for communication with the fingerprint scanner. Using this as reference, following are the connections: pin connections of Msp430g2553 with the scanner will be as follows for h/w serial: Tx of scanner --> P1.1 Rx of scanner--> P1.2 For s/w serial: (Connection within launchpad itself): Tx of J3 jumper (Down left pin, when Lp is held with USb plug at top) --> P1.7 Rx of J3 jumper (Upper right pin, when Lp is held with USb plug at top) --> P1.6 I have ported this Adafruit's scanner library from here https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library for Energia. The first basic enrollment example for it is as follows, which is for Arduino uno and it uses softwareserial for communication with the scanner *************************************************** This is an example sketch for our optical Fingerprint sensor Designed specifically to work with the Adafruit BMP085 Breakout ----> http://www.adafruit.com/products/751 These displays use TTL Serial to communicate, 2 pins are required to interface Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Written by Limor Fried/Ladyada for Adafruit Industries. BSD license, all text above must be included in any redistribution ****************************************************/ #include <Adafruit_Fingerprint.h> // On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white // uncomment this line: // #define mySerial Serial1 // For UNO and others without hardware serial, we must use software serial... // pin #2 is IN from sensor (GREEN wire) // pin #3 is OUT from arduino (WHITE wire) // comment these two lines if using hardware serial SoftwareSerial mySerial(2, 3); Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); uint8_t id; void setup() { Serial.begin(9600); while (!Serial); // For Yun/Leo/Micro/Zero/... delay(100); Serial.println("\n\nAdafruit Fingerprint sensor enrollment"); // set the data rate for the sensor serial port finger.begin(57600); if (finger.verifyPassword()) { Serial.println("Found fingerprint sensor!"); } else { Serial.println("Did not find fingerprint sensor :("); while (1) { delay(1); } } } // ..... So keeping this as reference, i have tried to write a code Where i use Softwareserial for debugging serial monitor and i use hardwareserial for communication with the scanner. I am sure about the former, but unsure about the latter. Following is the code i wrote: #include <SoftwareSerial.h> #include <Adafruit_Fingerprint.h> #define mySerial Serial1 SoftwareSerial mySerial2(P1_7,P1_6); // Rx, TX for debugging Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); uint8_t id; void setup() { // put your setup code here, to run once: mySerial2.begin(9600); // while (!mySerial2); delay(100); mySerial2.println("\n\nAdafruit fingerprint sensor enrollment"); finger.begin(57600); if (finger.verifyPassword()) { mySerial2.println("Found fingerprint sensor!"); } else { mySerial2.println("Did not find fingerprint sensor :("); while (1) { delay(1); } } } void loop() { // put your main code here, to run repeatedly: } When compiled, i get the following errors: Please can you suggest changes in the code i've written to achieve what i intend to do? I think the problem lies in the hardwareserial itself, but can't figure out what exactly. Thanks for your help.
  2. @energia can you please help ? Thanks.
  3. Ebrahim

    Bluetooth module HC-05

    Hi @danielhuber . Can you please post the associated code you used with this setup? The link you have given no longer exists. Thanks.
  4. Hi all. I am working on a very similar project. I understood what @abecedarian suggested and also followed the links @yosh posted. I am only confused about the change in the code that should be made so as to use H/w serial for communication with scanner and using s/w serial for communicating back from scanner to Msp (Serial monitor)... can anyone please suggest changes in the code below ? @energia This is the example enrollment code from the adafruit's fingerprint scanner library. I need to know how can we use h/w serial and s/w serial together here. Thanks in advance Pin out with Msp430g2553 will be as follows for h/w serial: Tx of scanner --> P1.1 of the Lp Rx of scanner--> P1.2 of the Lp For s/w serial: (Connection within launchpad itself): Tx of J3 jumper (Down left pin, when Lp is held with USb plug at top) --> P1.7 Rx of J3 jumper (Upper right pin, when Lp is held with USb plug at top) --> P1.6 /*************************************************** This is an example sketch for our optical Fingerprint sensor for Arduino borads Designed specifically to work with the Adafruit BMP085 Breakout ----> http://www.adafruit.com/products/751 These displays use TTL Serial to communicate, 2 pins are required to interface Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Written by Limor Fried/Ladyada for Adafruit Industries. BSD license, all text above must be included in any redistribution ****************************************************/ #include <Adafruit_Fingerprint.h> // On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white // uncomment this line: // #define mySerial Serial1 // For UNO and others without hardware serial, we must use software serial... // pin #2 is IN from sensor (GREEN wire) // pin #3 is OUT from arduino (WHITE wire) // comment these two lines if using hardware serial SoftwareSerial mySerial(2, 3); Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); uint8_t id; void setup() { Serial.begin(9600); while (!Serial); // For Yun/Leo/Micro/Zero/... delay(100); Serial.println("\n\nAdafruit Fingerprint sensor enrollment"); // set the data rate for the sensor serial port finger.begin(57600); if (finger.verifyPassword()) { Serial.println("Found fingerprint sensor!"); } else { Serial.println("Did not find fingerprint sensor :("); while (1) { delay(1); } } } uint8_t readnumber(void) { uint8_t num = 0; while (num == 0) { while (! Serial.available()); num = Serial.parseInt(); } return num; } void loop() // run over and over again { Serial.println("Ready to enroll a fingerprint!"); Serial.println("Please type in the ID # (from 1 to 127) you want to save this finger as..."); id = readnumber(); if (id == 0) {// ID #0 not allowed, try again! return; } Serial.print("Enrolling ID #"); Serial.println(id); while (! getFingerprintEnroll() ); } uint8_t getFingerprintEnroll() { int p = -1; Serial.print("Waiting for valid finger to enroll as #"); Serial.println(id); while (p != FINGERPRINT_OK) { p = finger.getImage(); switch (p) { case FINGERPRINT_OK: Serial.println("Image taken"); break; case FINGERPRINT_NOFINGER: Serial.println("."); break; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); break; case FINGERPRINT_IMAGEFAIL: Serial.println("Imaging error"); break; default: Serial.println("Unknown error"); break; } } // OK success! p = finger.image2Tz(1); switch (p) { case FINGERPRINT_OK: Serial.println("Image converted"); break; case FINGERPRINT_IMAGEMESS: Serial.println("Image too messy"); return p; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); return p; case FINGERPRINT_FEATUREFAIL: Serial.println("Could not find fingerprint features"); return p; case FINGERPRINT_INVALIDIMAGE: Serial.println("Could not find fingerprint features"); return p; default: Serial.println("Unknown error"); return p; } Serial.println("Remove finger"); delay(2000); p = 0; while (p != FINGERPRINT_NOFINGER) { p = finger.getImage(); } Serial.print("ID "); Serial.println(id); p = -1; Serial.println("Place same finger again"); while (p != FINGERPRINT_OK) { p = finger.getImage(); switch (p) { case FINGERPRINT_OK: Serial.println("Image taken"); break; case FINGERPRINT_NOFINGER: Serial.print("."); break; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); break; case FINGERPRINT_IMAGEFAIL: Serial.println("Imaging error"); break; default: Serial.println("Unknown error"); break; } } // OK success! p = finger.image2Tz(2); switch (p) { case FINGERPRINT_OK: Serial.println("Image converted"); break; case FINGERPRINT_IMAGEMESS: Serial.println("Image too messy"); return p; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); return p; case FINGERPRINT_FEATUREFAIL: Serial.println("Could not find fingerprint features"); return p; case FINGERPRINT_INVALIDIMAGE: Serial.println("Could not find fingerprint features"); return p; default: Serial.println("Unknown error"); return p; } // OK converted! Serial.print("Creating model for #"); Serial.println(id); p = finger.createModel(); if (p == FINGERPRINT_OK) { Serial.println("Prints matched!"); } else if (p == FINGERPRINT_PACKETRECIEVEERR) { Serial.println("Communication error"); return p; } else if (p == FINGERPRINT_ENROLLMISMATCH) { Serial.println("Fingerprints did not match"); return p; } else { Serial.println("Unknown error"); return p; } Serial.print("ID "); Serial.println(id); p = finger.storeModel(id); if (p == FINGERPRINT_OK) { Serial.println("Stored!"); } else if (p == FINGERPRINT_PACKETRECIEVEERR) { Serial.println("Communication error"); return p; } else if (p == FINGERPRINT_BADLOCATION) { Serial.println("Could not store in that location"); return p; } else if (p == FINGERPRINT_FLASHERR) { Serial.println("Error writing to flash"); return p; } else { Serial.println("Unknown error"); return p; } }
  5. Hi all. I have been working on a fingerprint based project using adafruit's fingerprint scanner from here http://www.adafruit.com/products/751 . I have been successfully using this with Arduino uno with the help of the following library provided by adafruit itself, from here: https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library Now, i have to switch from Arduino to Msp430g2553 LP. Can you'll please guide me with the following? : 1) How to port This library to Energia? I know the basic part is to replace Arduino.h and associated code with #include <energia.h>, but is there anything else i need to do? 2) How do work with SoftwareSerial in this case? I've read we cannot use baud rate above 9600 with g2553, is it true? Is there anyone who has worked on a similar project? Any help will be truly appreciated. Thanks in advance.
×