Shop OBEX P1 Docs P2 Docs Learn Events
Datalogger and BS2: Write to a file. — Parallax Forums

Datalogger and BS2: Write to a file.

sugusharma238sugusharma238 Posts: 7
edited 2011-01-26 16:18 in BASIC Stamp
Hello Sir/Madam,

I am currently working on the BS2 stamp (on the parallax homework board) along with the data-logger and the RFID reader.

Motive: When a person tries to access a locked door, he/she flashes their RFID tag infront of the RFID reader (placed on the door). The reader then identifies whether this tag is authorized or not. If the tag is authorized/ successfully found, it stores the name and time of the person's arrival and opens the door for them.

Can someone help me write a code and explain to me how I could ask a user to input some text, (for example: The user is asked: "Please enter your name" and then the name is registered and the message is displayed) and then store it into the Datalogger (#27937) through a USB. I am currently working on the Test and Demo.BS2 files to write my own code to store a person's name (and eventually time using the time keeping chip and the RFID reader) onto the datalogger using a USB to then read on a PC.

Any advice would be greatly appreciated [noparse]:)[/noparse]

Thank you.

Sugandha Sharma.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-07-16 00:05
    1) There is existing sample code for the RFID reader where the program compares the RFID code to a table in EEPROM. Have you gotten that to work yet? What you want to do is very similar and you should be able to use portions of the sample programs. There are links from Parallax's webstore page for the RFID reader.

    2) Similarly, there's sample code for the data-logger that reads and writes data. Use that as your starting point.

    3) Have you thought about how the user will be asked for their name and how they will enter it. Will this be through a connected PC or some keyboard and display?

    4) As with any moderately large project like yours, you need to start with existing examples and modify step-wise towards what you want to do. This sounds like a school / university project and, as such, we can offer assistance and advice, but not detailed help. Please let us know about specific questions or problems as you go along. The more information you provide when you ask something, the easier it will be to provide you with a useful answer rather than something general. If you supply pieces of your code (as you should), please be sure to use the Attachment Manager that you get by using the Post Reply button. You can use the [noparse][[/noparse] code ] and [noparse][[/noparse] /code ] tags, but the forum software will still use some bracketed (subscript) items for formatting.]
  • hamhog55hamhog55 Posts: 3
    edited 2011-01-25 09:01
    What type of data can the data logger take? I am trying to use a pressure sensor which outputs 0-5V. I have done the demo and that works ok, but how would I need to change the program to accept a voltage insted of time.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-01-26 16:18
    Read the datalogger documentation. The write command takes a byte count, then that number of bytes and writes the bytes to the file. As a result, you can write any byte sequence to a file. If you plan to use the resulting file with some kind of PC program, you do have to make sure that the recorded data is usable with the PC program and follows whatever rules that program has.
Sign In or Register to comment.