B4R Question hex file problem

sagmill

Member
Hi
I have a problem using the hex file generated by b4r.
I wrote a simple program that has a flashing led.

B4X:
#Region Project Attributes
    #AutoFlushLogs: True
    #CheckArrayBounds: True
    #StackBufferSize: 300
#End Region

Sub Process_Globals
    Public Serial1 As Serial
    Dim pin As Pin
End Sub

Private Sub AppStart
    Serial1.Initialize(9600)
    pin.Initialize(0,pin.MODE_OUTPUT)
    AddLooper("Looper1")
End Sub

Sub Looper1
    pin.DigitalWrite(True)
    Delay(2000)
    pin.DigitalWrite(False)
    Delay(2000)
End Sub

When I burn the hex file to an Atmega8a.
The LED light is very weak, although the program is correct and works properly.
I changed some settings such as boudrate or delay time between flashing or pin but the problem was not fixed.
is anyone helping?

1.jpg
 

sagmill

Member
Check the led resistor, the value is too high.
Use a simple online calculator and use the color of your led for calculation the resistor.

Thank you for reply
But I made a similar program with Arduino and burn hex file on this microcontroller and its worked correctly.
The problem seems to be how to compile b4r.
 
Upvote 0
Top