B4R Question Error: Must specify exactly one sketch file

Discussion in 'B4R Questions' started by Alfonso Hermida, Aug 25, 2018.

  1. Alfonso Hermida

    Alfonso Hermida Member Licensed User

    I compiled a project in B4R and I received the error : "Error: Must specify exactly one sketch file"

    Not sure since I only have 1 sketch. Any suggestions?
     
  2. tigrot

    tigrot Well-Known Member Licensed User

    Hard to say without seeing your project...
     
  3. Alfonso Hermida

    Alfonso Hermida Member Licensed User

    This is the code

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

    Sub Process_Globals
      
    Public Serial1 As Serial
      
    Private astream As AsyncStreams
      
    Private timer1 As Timer
      
    Private pins(2As Pin
    End Sub

    Private Sub AppStart
       Serial1.Initialize(
    115200)
       
    Log("appstart")
        Serial1.Initialize(
    9600)
        astream.Initialize(Serial1.Stream, 
    "astream_newdata"Null)
       timer1.Initialize(
    "Timer1_Tick"1000)
       timer1.Enabled = 
    True
       
    'Must be pwm pins as we are using AnalogWrite
       pins(0).Initialize(5, pins(0).MODE_OUTPUT)
       pins(
    1).DigitalWrite(True)
    End Sub

    Sub Timer1_Tick
       astream.Write(
    "Time: ".GetBytes)
       astream.Write(
    NumberFormat(Millis, 00).GetBytes)
    End Sub

    Sub astream_NewData (Buffer() As Byte)
       
    For i = 0 To Buffer.Length - 2 Step 2
         
    'Dim pinIndex As Byte = Buffer(i)
         Dim pinValue As Byte = Buffer(i + 1)
         
    'using constrain to avoid non allowed values
         pins(Constrain(501)).AnalogWrite(pinValue)  'only 1 LED right now
       Next
    End Sub
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Does it work with other projects? Can you post the error message from the logs?
     
  5. tigrot

    tigrot Well-Known Member Licensed User

    I see two initialize of Serial1, dunno if this can be the cause.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice