General area when it fits no where else

Moderator: Mmiscool

User avatar
By Ecoli-557
#51606 Greeting All!
I have been making great advances in this interpreter, but, coming from a background where I had slower clocks, not nearly the string handling stuff, the math functions are awesome, and all of the GUI screen stuff let alone the WEB stuff - Awesome!!

However, I need some examples of very basic functions such as comparing a pin to either high or low, how to assign a variable to a bit in a byte variable, any aliasing a variable to a pin, etc.

I have worked with the higher level functions and now I need to turn my attention to these lower functions so I can get a better idea how this thing actually works.

I will attach external single bit things to this chip, sense their status, send them out either wifi (so cool), serial or some other thing.

Any examples would be great!
User avatar
By Mmiscool
#51614 to get the status of a pin you can use the io() function.

Code: Select allbla = io(pi,d3)


or to check the pins state and run code based on it.

Code: Select allif io(pi,d3) = 1 then print "high" else print "low"

There is no mapping a pin to a variable. It is all controlled in the IO() function.
User avatar
By Ecoli-557
#51616 OK, thanks for the clarification.
We don't have anything like:
Flags, which would be classed as a byte variable.
And, relay=flags.0 which would be a single bit flag which is bit 0 of the byte 'Flags'.
It would be convienant.

Is there no way (or need) to declare a var as a bit, byte, word, or double-word?

Thanks for all you do,
Regards.
User avatar
By Mmiscool
#51617 Only have 2 variable types in esp basic. Strings and numbers. Numbers are floating point.