PDA

View Full Version : PICBasic Coding Help



hodgdre
- 27th November 2006, 15:53
First of all I would like to apologize because I believe my inquiry has nothing to do with the thread subject and considering these are some of the most current postings then I thought I might actually get a response by using this forum. If there is a better place to post then please direct me there.

I am a Mechanical Engineering student that has been given a project to finish in the last two weeks of class. I am supposed to use PICBasic to write a code that will allow a microcontroller to turn on a stepper motor that will, in turn, raise a gate once the proper entry code has been entered using a 3 button keypad. If the right code is entered then a green LED will light up, also prompting the motore. However, if the wrong code is entered a red LED will light up and no action will be prompted. I have never used PICBasic before to write such code, and the codes that I have written in the past were copied out of the textbook as part of a lab. I have done research on how to code this operation but every code that I discover is written for a 10-digit or more keypad. I am not familiar at all with the PICBaic program, as a I stated earlier, so if anyone could offer any help whatsoever on how to code such an operation, which is slightly more in depth than previously stated, any help would be much apprecaited considering I also have 3 other projects due in the next two weeks. Thank you for your time.

sayzer
- 27th November 2006, 16:44
If you start from somewhere and post some kind of progress here that will prove that you are actually making your project, trying to come up with some code, schematic etc.. then you will get lots of help here.

I do not think anyone will help you without you showing some kind of work on your self.

I suggest that you start with the schematic.

-----------------------

malc-c
- 27th November 2006, 22:17
I also have 3 other projects due in the next two weeks.

And no doubt you will want the same sort of assistance with then :)

As Sayzer mentioned, you should really come up with something first and then seek assistance with the debugging and improving stage. Reading your post it sounds as if you want someone to develop the code for you with-in a two week time period, which aint going to happen unless someone skilled enough has the time ( and you can afford their hourly rate :) )

Think about it logically:

You need to scan a keypad, detect the string of numbers, match them to the pre-programmed string. If they match then change the state of a pin to drive the green Led and activate the motor, or if they don't then change the state of a pin that drives the red LED.

Take a look at the PicBASIC pro manual - most of the things you need are documented there, so its a place to start.

skimask
- 28th November 2006, 00:26
You know what I'm going to say....

Mech Student...Two weeks...Final Project...No info...Not even an attempt, a 'whats wrong with this code'...

>>First of all I would like to apologize because I believe my inquiry has nothing to do with the thread subject and considering these are some of the most current postings then I thought I might actually get a response by using this forum. If there is a better place to post then please direct me there.<<

www.google.com is a decent start...

Amazing isn't it!!! Right off the top of my head! WOW! Everything should be so easy! I've just outdone myself again! I think I'm going to give myself a 'good game', complete with a squeeze!

hodgdre
- 28th November 2006, 16:13
What is the 'DIM' command and 'EDATA' command used to prompt in PICBasic? I believe that 'EDATA' is used to save the password for your system, but I am still unsure about 'DIM'. If 'EDATA' is used to store the correct password, what would be the command used to compare the password entered by the user to the stored password? Would you just assign a variable name and compare it using a PICBasic function? Thank you for any help.

malc-c
- 28th November 2006, 16:36
Are you using PicBASIC or PicBASIC Pro ?

You have actually posted in the MELabs PicBasic Pro section, and looking at the manual (a good place to start http://www.melabs.com/resources/pbpmanual/ ) I cant see those commands listed.

hodgdre
- 28th November 2006, 16:45
Thanks Malc-c. I will try searching for it on there. I am not sure which version of PICBasic we are using. This is for a lab in one of my classes and the only time we can access the program is during the 1-hour period the lab session is held on Monday Wendesday and Friday. Thank you for your help.

Melanie
- 28th November 2006, 16:48
Neither PICBasic or PICBasic Pro uses EDATA.

However, always willing to help...

Q. What would be the command used to compare the password entered by the user to the stored password?

A. IF ...

malc-c
- 28th November 2006, 16:49
My gut feeling is that you're on the wrong forum.

It looks like those statements are found in the Proton PIC BASIC and not MELabs PicBASIC.

Have a look at their manual http://www.compile-it.com/protonds/proton_ds_userguide.pdf

It contains the DIM and EDATA statements you were on about

malc-c
- 28th November 2006, 16:52
... and if you need support try posting on thier forum

http://www.picbasic.org/forum/

malc-c
- 28th November 2006, 16:55
However, always willing to help...

Q. What would be the command used to compare the password entered by the user to the stored password?

A. IF ...

ROTFLMAO :) :) :)