In all B4X products, The end result is a converted NATIVE code version of the B4x app, so I expect that B4R will produce C converted versions, thus making its footprint as similar as possible to any equivalent C created codeHi ,i program Arduino in C . Arduino has low memory, i love Erel's work but i think that programmig Arduino in basic language reduces the available "program memory"
B4X:[code] pin13.Write(Not(pin13.Read))
pin13.Write(Not(pin13.Read)) is equivalent to:Hi Erel,
I thought it's pin13.Write(Not(pin13.Write)), because logically Write is already NOT Read, unless I am missing something.
Dim state As Boolean = pin13.Read
If state = true Then pin13.Write(false) Else pin13.Write(true)
In the same way that B4i (iOS) uses jar files... It doesn'tBut in your idea how to use jar file?
pin13.Write(Not(pin13.Read)) is equivalent to:
This causes the led to toggle its state.B4X:Dim state As Boolean = pin13.Read If state = true Then pin13.Write(false) Else pin13.Write(true)
+10000000000000 , that would be awesome!This is a preliminary test of a possible new development tool for Arduino devices (B4R).
Sub Process_Globals
Public Serial1 As Serial
Type TreeNode (Value As Int, Left As TreeNode, Right As TreeNode)
Private nodes(50) As TreeNode
Private nodesIndex As Byte
Private rootNode As TreeNode
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
For i = 0 To nodes.Length - 1
AddNode(Rnd(0, 5000))
Next
PrintNode(rootNode)
End Sub
Private Sub AddNode(value As Int)
Dim n As TreeNode = nodes(nodesIndex)
nodesIndex = nodesIndex + 1
n.Value = value
If rootNode = Null Then
rootNode = n
Else
InsertNode(rootNode, n)
End If
End Sub
Private Sub PrintNode(n As TreeNode)
If n.Left <> Null Then PrintNode(n.Left)
Log("Node: ", n.Value)
If n.Right <> Null Then PrintNode(n.Right)
End Sub
Private Sub InsertNode(Parent As TreeNode, NewNode As TreeNode)
If NewNode.Value > Parent.Value Then
If Parent.Right <> Null Then
InsertNode(Parent.Right, NewNode)
Else
Parent.Right = NewNode
End If
Else
If Parent.Left <> Null Then
InsertNode(Parent.Left, NewNode)
Else
Parent.Left = NewNode
End If
End If
End Sub
Libraries will be written in C++.
No. B4R programs will only run on Arduino (it is possible that in the future other microcontrollers will be supported).i have to communicate with a non arduino - specialized Camera that has its libraries in C++, would it be possible to create a program for it with B4R?
There is still quite a lot of work ahead. It will take some time.When we can have the alpha/beta version?
Like a Microchip PICs ? I was attending to ask would it be possible maybe in future to ad them as well , but I thought,it is possible that in the future other microcontrollers will be supported