Current News

Moderator: Mmiscool

User avatar
By Mmiscool
#34478 Added a new function that will allow for use of i/o from a function

Useful for in if then statements and for math applying to input from a pin.

Example:
Code: Select allif io(pi,0) = 1 then print "Pin high" else print "pin low"


Also the below will now work:
Code: Select allbla = io(pwi,0)


Functions can be called with out returning a value:
Code: Select allio(pwo,0,500)


Syntax is same as normal commands. Just in the form of a function.
User avatar
By forlotto
#34479 A valiant effort and a much improved ide imho with this tid bit of code.
User avatar
By forlotto
#34750 That does leave me with the question after messing about a little more.

How would you reference TX, RX, and A0 as pins?

D9 or RX?
D10 or TX?
A0 or D11?

Leaves me a bit curious on what the proper syntax is in these cases?
According to the MAP you left here download/file.php?id=1668&mode=view
User avatar
By Mmiscool
#34764 You can use the rx and ty pin like so

Code: Select allpo RX 1


There is only one analog input so there is no need to reference the pin number at all.

Code: Select allai bla
print bla



internally the code looks like this.
Code: Select all  if (PinDesignaor == "D0")  pin = 16;
  if (PinDesignaor == "D1")  pin = 5;
  if (PinDesignaor == "D2")  pin = 4;
  if (PinDesignaor == "D3")  pin = 0;
  if (PinDesignaor == "D4")  pin = 2;
  if (PinDesignaor == "D5")  pin = 14;
  if (PinDesignaor == "D6")  pin = 12;
  if (PinDesignaor == "D7")  pin = 13;
  if (PinDesignaor == "D8")  pin = 15;
  if (PinDesignaor == "RX")  pin = 3;
  if (PinDesignaor == "TX")  pin = 1;