jon i spoke to you earlier in the week, i ordered the starter kit yesterday. Is it possible to mess it up by writng a bad code, or will it just not do anything? I look in the programing basics and think i understand, then look here and get overwhelmed. Is there somewhere i can look to see simple codes, to try just to see how/what they do, when i add or change something.
Also, do you type all of what is on your codes every time, ex. pbasic, stamp1, constants, main, variables, so on, or is it a template?
You can't hurt the controller writing bad code -- unless that "bad" code is directing pins that are supposed to be inputs to become outputs; that can present a problem. We have some protections on the board, but they won't cover everything. Just be careful in your code, and if you're unsure, post it (and the connections) here for review.
ok, thanks, do you type in all the dashes and all the other stuff or just the code itself?
I only typed those dashes once; then I save them into a template that my editor loads up every time do a File >> New operation. You can find that template in the Library forum under Prop-1: http://www.efx-tek.com/php/smf/index.php?topic=4.0
ok,i see it, i try to read first then ask ? been reading on here all week, so much to learn.
i recieved my prop 1. im trying to use the prop trainer, when i hit run it downloded and it said tokenize/download complete
when i hit the trigger on trainer i get nothing did i not do something?
program
' =========================================================================
'
' File......
' Purpose...
' Author....
' E-mail....
' Started...
' Updated...
'
' {$STAMP BS1}
' {$PBASIC 1.0}
'
' =========================================================================
' -----[ Program Description ]---------------------------------------------
' -----[ Revision History ]------------------------------------------------
' -----[ I/O Definitions ]-------------------------------------------------
SYMBOL Trigger = PIN6 'Setup DN
SYMBOL LED1 = PIN0
SYMBOL LED2 = PIN4
' -----[ Constants ]-------------------------------------------------------
SYMBOL IsOn = 1
SYMBOL IsOff = 0
' -----[ Variables ]-------------------------------------------------------
' -----[ Initialization ]--------------------------------------------------
PAUSE 10000
' -----[ Program Code ]----------------------------------------------------
Main:
IF Trigger = IsOff THEN Main 'wait for trigger
LED1 = IsOn
PAUSE 2500
LED2 = IsOn
PAUSE 3000
Led2 = IsOff
PAUSE 1000
Led1 = IsOff
GOTO Main
' -----[ Subroutines ]-----------------------------------------------------
' -------------------------------------------------------------------------
' -------------------------------------------------------------------------
' -------------------------------------------------------------------------
' -------------------------------------------------------------------------
' -------------------------------------------------------------------------
' -----[ EEPROM Data ]-----------------------------------------------------
The reason you weren't seeing anything is that you didn't make the output pins outputs -- by default, all I/O is configured as inputs on startup. There are a couple ways to do this, the easiest (I think) is to configure desired output pins using the DIRS register. Here's a corrected version of your program:
' =========================================================================
'
' File......
' Purpose...
' Author....
' E-mail....
' Started...
' Updated...
'
' {$STAMP BS1}
' {$PBASIC 1.0}
'
' =========================================================================
' -----[ Program Description ]---------------------------------------------
' -----[ Revision History ]------------------------------------------------
' -----[ I/O Definitions ]-------------------------------------------------
SYMBOL Trigger = PIN6 ' Setup = DN
SYMBOL LED2 = PIN4
SYMBOL LED1 = PIN0
' -----[ Constants ]-------------------------------------------------------
SYMBOL IsOn = 1
SYMBOL IsOff = 0
' -----[ Variables ]-------------------------------------------------------
' -----[ Initialization ]--------------------------------------------------
Reset:
DIRS = %00010001 ' configure output pins
PAUSE 10000
' -----[ Program Code ]----------------------------------------------------
Main:
IF Trigger = IsOff THEN Main ' wait for trigger
LED1 = IsOn
PAUSE 2500
LED2 = IsOn
PAUSE 3000
Led2 = IsOff
PAUSE 1000
Led1 = IsOff
GOTO Main
' -----[ Subroutines ]-----------------------------------------------------
' -------------------------------------------------------------------------
' -------------------------------------------------------------------------
' -------------------------------------------------------------------------
' -------------------------------------------------------------------------
' -------------------------------------------------------------------------
' -----[ EEPROM Data ]-----------------------------------------------------
ok, i haven't tried it but im sure it will work. I've been looking at that, will that (dirs) work every time, or better yet what it it doing?
what is it causing, i know i can't learn all in a day but i want to understand. the other parts i took from here and there to see what would happen
i think i got it (Dirs), 00010001 the last 1 is pin 0, 5th from last being pin 4?
Yes. You can real all about DIRS in the help file; double-click on DIRS in the listing to highlight it and then press the F1 key.