• PicŪ Basic


  • MedianFilter

    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 MedianFilter

    Syntax

    MedianFilter Array, Elements

    Overview

    Returns the median of the array by performing a bubble sort on the array and selecting the resulting middle element.

    Operators

    Array – any Byte array

    Elements - a constant, or byte variable indicating the number of elements within the array to sort

    Code:
    Include "PROTON_4.inc"
    Dim myarray[10] As Byte
    Dim index As Byte
    Dim temp As Byte
    
        Seed $0345
    
        For index = 0 To 9
            temp = Random
            myarray[index] = temp
            HRSOut Dec temp,32
        Next
    
        HRSOut 10,13
        temp = MedianFilter myarray, 10
        HRSOut "the median of the array is ",Dec temp
    
        Stop
    The above example code will fill an array with random values then extract the middle value.
    Notes:

    The array will be rearranged. Where the array is an even number the lower of the middle elements will returned.


    Download module

    Download: MedianFilter
  • Recent Activity

    towlerg-21522

    FineLineIDE

    Thread Starter: normnet

    Coming soon a new IDE: FineLineIDE! Features include:<O:p</O:p Bracket lines linking If-Endif, For-Next etc.<O:p</O:p Tabbed explorer so...

    towlerg Today, 16:49 Go to last post
    evoortman-388

    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...

    evoortman Today, 11:13 Go to last post
    amod-29593

    Multiple functions by a single switch

    Thread Starter: amod

    Hi, How can I use multiple function by a single switch.I want to use 4 functions by a single switch.

    amod Today, 17:15 Go to last post
    towlerg-21522

    FUSES for PIC18F47K20

    Thread Starter: gtv_pic

    000 Good morning I am using the PIC18F47K20 and in the help of the proton I did not locate the FUSES for said micro. Where can I locate...

    towlerg Today, 14:52 Go to last post