bh 1415f and picbasic problem


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007
    Posts
    3

    Default bh 1415f and picbasic problem

    i have make a program in picbasic but it do not write to the bh1415 this is my program can some one fixed it

    '************************************************* ***************
    '* Name : UNTITLED.BAS *
    '* Author : Patrick Klok *
    '* Notice : Copyright (c) 2007 *
    '* : All Rights Reserved *
    '* Date : 30-8-2007 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '************************************************* ***************
    DEVICE 16F628A ;Gebruik een 16F628A type
    CONFIG INTRC_OSC_NOCLKOUT, WDT_OFF, PWRTE_ON, LVP_OFF, MCLRE_OFF




    ALL_DIGITAL = 1
    LCD_TYPE = 0
    LCD_INTERFACE = 4
    LCD_LINES = 2
    LCD_DTPIN = PORTB.0
    LCD_ENPIN = PORTA.3
    LCD_RSPIN = PORTA.2


    DIM Teller AS DWORD ;Deze variabele bevat de Teller
    DIM Freq AS DWORD ;Deze variabele bevat de Freq
    DIM BH1415 AS DWORD ;Deze variabele bevat de BH1415
    dim ACTIE AS BYTE
    Symbol AAN = 0
    Symbol UIT = 1


    Symbol S1 = PORTA.6
    Symbol S2 = PORTA.7
    Symbol S3 = PORTA.0
    Symbol S4 = PORTA.1
    symbol DTA = portb.5
    symbol CLK = portb.6
    symbol ENB = portb.7


    CLEAR ;Wis alle RAM geheugen
    DELAYMS 500 ;LCD stabilisering
    cls
    PRINT AT 1, 1, "TEST VERSION 0.9" ;
    PRINT AT 2, 1, "PLL TRANSMITTER" ;
    DELAYMS 2000
    CLS ;Scherm wissen
    Teller = Eread 0 ;Haal laatst ingestelde freq op
    IF Teller < 875 then Teller = 875 ; als teller kleiner is dan 87.5 mhz teller = 87.5 mhz
    IF Teller > 1080 then Teller = 1080 ;

    ACTIE=1

    ;Hoofdprogramma
    WHILE 1 = 1



    If S1 = AAN and Teller < 1080 THEN
    Teller = Teller +1 ; Freq verhogen
    DELAYMS 25 ;Anti contactdender
    WHILE S1 = AAN : WEND ;Wacht tot S1 wordt losgelaten
    ACTIE = 1
    ENDIF



    If S2 = AAN and Teller > 875 Then
    Teller = Teller - 1 ; Freg verlagen
    DELAYMS 25 ;Anti contactdender
    WHILE S2 = AAN : WEND ;Wacht tot S2 wordt losgelaten
    ACTIE = 1
    ENDIF

    if ACTIE = 1 then
    BH1415 = Teller
    BH1415.11 = 1
    BH1415.12 = 1
    BH1415.13 = 0
    BH1415.14 = 1
    BH1415.15 = 0
    ENB = 1
    DELAYMS 5
    SHOUT DTA , CLK , lsbFIRST , [ BH1415 \ 16 ]
    DELAYMS 5
    ENB = 0

    ACTIE = 0
    endif






    Freq = Teller

    PRINT AT 1, 1, DEC Freq/10, ".",DEC1 Freq, " MHZ", " STEREO";Met 1 cijfer na de komma

    PRINT AT 2, 1,"PLL TRANSMITTER" ;


    EWRITE 0, [Teller] ; schrijf de ingestelde freq naar eeprom





    WEND
    END ;Einde programma

  2. #2
    Join Date
    Jul 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Thumbs down Picbasic ???

    Well, this is looking like a basic program, NOT picbasic

    There are many invalid picbasic commands/statements in your program. I think you should read the picbasic manual first before trying to do any programming.

    DIM, PRINT, DELAYMS, SHOUT, EWRITE, CLS are NOT valid commands
    IF/THEN are not used properly (missing ENDIF)
    Variable are not declared the correct way

    And there is probably many more errors...

    J-P

  3. #3
    Join Date
    Aug 2007
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    it is in proton picbasic

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    The Proton forum is at

    http://www.picbasic.org/forum/

    This forum is for PicBasic Pro.

    .
    DT

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts