• Pic® Basic


  • MidPoint

    A library module for use with Library Manager by JohnGB. This module has been written by Tim Box (Tim on PDS forum). The library module is offered on an as-is basis with no warranty as to its effectiveness, operation or reliability. Users use it at their own risk.

    Adds a new command called MidPoint

    Syntax

    MidPoint High Number, Low Number

    Overview

    Returns the mid point between the two numbers.

    Operators

    High Number – a number, byte or word variable Low Number – a number, byte or word variable

    Code:
    Include "PROTON_4.INC"
    Dim A As Word
    Dim B As Word
    
        A = 500
        B = MidPoint A,200
        HRSOut "The mid point of ", Dec A,", 200 is ", Dec B
        Stop


    Download module

    Download: MidPoint
  • Recent Activity

    xldaedalus-432

    Mysterious PORTB problem

    Thread Starter: xldaedalus

    I'm using Proton+ to develop firmware for a product with switches. The MCU is an 18F26K22. Most of the switches reside on PORTB. I am NOT using a...

    xldaedalus Yesterday, 23:42 Go to last post
    towlerg-21522

    Pic16f18877 oread

    Thread Starter: evoortman

    Hi, On a PIC16F18877 the OREAD command doesn't seem to work. The code is working on a PIC16F1939. Both controllers use 32MHz int osc. If i...

    towlerg Yesterday, 15:38 Go to last post
    Tim-107

    Lin bus and auto baud detection

    Thread Starter: Tim

    Lin bus looks to be a great system for an application i'm working on. One of the main things is the slave can be really simple without needing a...

    Tim Yesterday, 18:28 Go to last post