|
Post by Admin on Feb 23, 2020 21:19:44 GMT
And many thanks to Richard Russell (the creator of BBCSDL and BBC4W) for helping me learn how to do this.. This is so awesome, as I can now automate heating controls and other things. Here is my own custom pin control for my water element I will make a video for later. * The time will be changed, as water takes longer to heat than what is shown. This will turn my relay on and off quickly. I made some custom tools and you are free to apply it to your project if you need it.
REM Initialise GPIO: INSTALL @lib$ + "gpiolib" GPIO% = FN_gpio_setup REM custom command for 1 pin use (I will make a mass pin tool later) PROC_pinprep(24):REM assumes that you are just using 1 pin(GPIO 24 PROC_pin(24,"ON"):REM turn on pin 24 for relay WAIT 20:REM lets assume that my water takes this long to heat PROC_pin(24,"OFF"):REM turn off pin 24 END REM lets make it custom REM so for example PROCpin(24,"ON") or PROCpin(24,"OFF") DEF PROC_pin(pin%,onoff$) IF onoff$="ON" THEN PROC_gpio_set(GPIO%, 1 << pin%) IF onoff$="OFF" THEN PROC_gpio_clr(GPIO%, 1 << pin%) ENDPROC REM made this to do the required pin input/output cycle DEFPROC_pinprep(pin%) PROC_gpio_inp(GPIO%, pin%) PROC_gpio_out(GPIO%, pin%) ENDPROC
|
|