Red LED and two buttons

Erel

B4X founder
Staff member
Licensed User
Longtime User
SS-2016-03-07_11.41.35.jpg


B4X:
Sub Process_Globals
   Dim button1, button2, pin6 As Pin
End Sub

Sub AppStart
   pin6.Initialize(6, pin6.MODE_OUTPUT)
   button1.Initialize(7, button1.MODE_INPUT_PULLUP)
   button2.Initialize(8, button2.MODE_INPUT_PULLUP)
   button1.AddListener("Button_Change")
   button2.AddListener("Button_Change")
End Sub

Sub Button_Change (Value As Boolean)
   Log("Button Change")
   'Value will be false when the button is pressed because of the pull up resistor.
   If Button1.Read = True Or Button2.Read = True Then
     pin6.Write(False)
   Else
     pin6.Write(True)
   End If
End Sub

Blink program:

B4X:
Sub Process_Globals
   Dim pin13 As Pin
   Dim Timer1 As Timer
End Sub

Sub AppStart
   pin13.Initialize(13, pin13.MODE_OUTPUT)
   Timer1.Initialize("Timer1_Tick", 1000)
   Timer1.Enabled = True
End Sub

Sub Timer1_Tick
   pin13.Write(Not(pin13.Read))
End Sub
 

Cableguy

Expert
Licensed User
Longtime User
I think since it's a .jar file, just runs directly from the SD card
 

inakigarm

Well-Known Member
Licensed User
Longtime User
I think it's a great idea !! I mostly hate actual Arduino IDE

Must it run with usb cable connected (like scratch) or loading the code/standalone ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Must it run with usb cable connected (like scratch) or loading the code/standalone ?
It is really too early to get into any technical detail. I'm just exploring the idea for now.

If it will happen then B4R will create regular standalone programs.
 

Cableguy

Expert
Licensed User
Longtime User
This is a preliminary test of a possible new development tool for Arduino devices (B4R).

As I said, so many doors are opening!
B4x is entering the iot hardcore market!
Soon, no more undecipherable sketches!
 

MODERN TALKING

Active Member
Licensed User
Longtime User
Speaking of LED Lights and a Cybernetic Genius:

I PROGRAM MY HOME COMPUTER - BEAM MYSELF INTO THE FUTURE.

 

canalrun

Well-Known Member
Licensed User
Longtime User
Cool!

I was just playing with a Mega this past weekend.

A company called Z-Wave.Me, http://z-uno.z-wave.me/, is developing a module plus software that should allow an Arduino to become a device on a Z-Wave network.

Can't wait for this to happen.

Barry.
 

barx

Well-Known Member
Licensed User
Longtime User
Interesting news,

I've had a Uno (genuine) and Nano (fake) ages and never really done much with them. This could open a few doors though.
 

KitCarlson

Active Member
Licensed User
Longtime User
It is a nice idea, but how will it compete performance wise, to a C cross compiler to AVR.asm?

I use AVR, and Ardruino for prototyping designs, with CVAVR. My code development is for automotive engine controls. Timer controls for me involve input captures, and output compares.
 
Last edited:
Top