Hello Darrel, I have bought the PBP and I am happy, if I need its aid I can write to him?.
Thanks
Leonardo
Originally Posted by Darrel Taylor
Hello Darrel, I have bought the PBP and I am happy, if I need its aid I can write to him?.
Thanks
Leonardo
Originally Posted by Darrel Taylor
Hello Leonardo,
Leaonardo, Dave gave you some wonderful working code... You can do it on your 675 if you want....Code:Minutes VAR Word Hours VAR Word Days VAR Word loop: HIGH LED GOTO LOOP OPTION_REG = $7f Wait40Days: For Days = 1 to 40 For Hours = 1 to 24 For Minutes = 1 to 60 PAUSE 60000 ; 60 Seconds Next Minutes Next Hours Next Days
Now about your code...
>>
loop:
HIGH LED
GOTO LOOP
<<
None of your pins are assigned to outputs... granded HIGH changes it to OUTPUT, but turn off your AD's and compariters for "Habit" sake.
you have this loop, and it is going to turn on your LED...but never turn it off...
Your interput is not configured properly... check out the manual on how to use interupts...
your subroutine of 40 days is does not have a return, nor does it have a interupt turnoff.
Dwayne
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Hola Leonardo,
Ahora que usted tiene PicBasic Pro. La manera más fácil de hacer el programa de 40 días es utilizar el primer ejemplo que di al principio de este thread.
Primero, usted necesita Download el programa de
http://www.picbasic.co.uk/forum/showthread.php?t=190
Entonces, intente esto...Code:<font color="#008000"><b>CLEAR </b></font><b>Bcount </b><font color="#008000"><b>VAR BYTE INCLUDE </b></font><font color="#FF0000">"Elapsed.pbp" </font><font color="#0000FF"><b><i>; Include the Elapsed Timer Routines </i></b></font><font color="#008000"><b>GOSUB </b></font><b>ResetTime </b><font color="#0000FF"><b><i>; Reset Time to 0d-00:00:00.00 </i></b></font><b>Start</b>: <b>Bcount </b>= <b>0 MainLoop</b>: <font color="#008000"><b>BUTTON </b></font><b>PORTB</b>.<b>1</b>,<b>0</b>,<b>200</b>,<b>255</b>,<b>Bcount</b>,<b>1</b>,<b>Start40 </b><font color="#0000FF"><b><i>; Wait for button press </i></b></font><font color="#008000"><b>PAUSE </b></font><b>1 </b><font color="#008000"><b>GOTO </b></font><b>MainLoop Start40</b>: <font color="#008000"><b>GOSUB </b></font><b>StartTimer </b><font color="#0000FF"><b><i>; Start the Elapsed Timer </i></b></font><b>Loop40</b>: <font color="#008000"><b>IF </b></font><b>DaysChanged</b>= <b>1 </b><font color="#008000"><b>THEN </b></font><b>DaysChanged</b>= <b>0 </b><font color="#008000"><b>IF </b></font><b>Days </b>= <b>40 </b><font color="#008000"><b>THEN </b></font><font color="#0000FF"><b><i>; Has it been 40 days </i></b></font><font color="#008000"><b>GOSUB </b></font><b>StopTimer </b><font color="#008000"><b>GOSUB </b></font><b>ResetTime </b><font color="#0000FF"><b><i>; Reset Elapsed Timer </i></b></font><font color="#008000"><b>HIGH </b></font><b>PORTB</b>.<b>0 </b><font color="#0000FF"><b><i>; Turn ON output </i></b></font><font color="#008000"><b>PAUSE </b></font><b>10000 </b><font color="#0000FF"><b><i>; Hold output high for 10 seconds </i></b></font><font color="#008000"><b>LOW </b></font><b>PORTB</b>.<b>0 </b><font color="#0000FF"><b><i>; Turn OFF output </i></b></font><font color="#008000"><b>GOTO </b></font><b>Start </b><font color="#0000FF"><b><i>; go back to beginning. </i></b></font><font color="#008000"><b>ENDIF ENDIF </b></font><font color="#0000FF"><b><i>; .. You can do other things here while waiting for 40 days (if needed) .. </i></b></font><font color="#008000"><b>GOTO </b></font><b>Loop40</b>
DT
Hola Darrel,
Gracias por contestarme en mi idioma natal el español, estoy muy agradecido por su ayuda y hare lo que me dice.
Muchas Gracias
Leonard
Originally Posted by Darrel Taylor
Bookmarks