Trying to use a function or a sub to return a value on demand. Not working for
This has to be something simple. I am attempting to call a function to fill a variable. This is in relation to my RPM detection post.
Here is a sample of what I am trying to do :
getrpm SUB 0
Main:
currentrpm = getrpm
' CODE TO DISPLAY RPM
...
...
...
Goto Main
getrpm:
...
...
...
RETURN rpm
What am I doing wrong? It is getting dark outside and I am running out of time to test this [noparse]:([/noparse]
Here is a sample of what I am trying to do :
getrpm SUB 0
Main:
currentrpm = getrpm
' CODE TO DISPLAY RPM
...
...
...
Goto Main
getrpm:
...
...
...
RETURN rpm
What am I doing wrong? It is getting dark outside and I am running out of time to test this [noparse]:([/noparse]
Comments
Then code the function like this:
If the RPM value can be a word then you need to change the declaration to 2.
FUNCs do.
FUNCs are declared as:
name FUNC returnbytes, sendbytesmin{,sendbytesmax}
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
That was on fire when I got here...
www.iElectronicDesigns.com
·
1st : Is there any way to detect ohms? Like if I had a potentiometer connected between ground and a pin, could the chip process the ohm rating or calculate it into a percentage? Example : 0 ohms = 100%, 100k ohms = 0%
2nd : Can a pin be programmed to have a gradual increase or decrease in voltage out?
2nd: Use the PWM command
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Uhhhm, that was on fire when I got here...
www.iElectronicDesigns.com
·