pseudofinch


Namepseudofinch JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryAn emulation library inspired by the Finch 2.0 made by BirdBrain Technologies.
upload_time2025-02-03 06:39:59
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseMPL2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# PseudoFinch

Simulates most functions of the BirdBrain Technologies Finch 2.0 Robot.


## Documentation

[Documentation](https://quarksay.github.io/PseudoFinch/)

# Constructors: 
## Method Signature: Finch()
    Description: Constructor that creates an object corresponding to a Finch.
    Example: myFinch = Finch("Name")

# Output Methods: 

## Method Signature: setMove(direction, distance, speed)
    Description: Moves the Finch forward or backward for a specified distance at a specified speed. The method requires a direction (‘F’ for forward or ‘B’ for backward), a distance in centimeters, and a speed from 0-100.
    Example: myFinch.setMove(‘F’,10,50)

## Method Signature: setTurn(direction, angle, speed)
    Description: Turns the Finch right or left for a specified angle at a specified speed. The method requires a direction (‘R’ for right or ‘L’ for left), an angle in degrees, and a speed from 0-100.
    Example: myFinch.setTurn(‘R’,90,50)

## Method Signature: setMotors(leftSpeed, rightSpeed)
    Description: Sets the Finch wheels to spin at the given speeds. The method requires two speeds between -100 and 100 for the left and right wheels. Setting the speed to 0 turns the motor off.
    Example: myFinch.setMotors(-50,50)

## Method Signature: stop()
    deprecated :(

## Method Signature: setBeak(redIntensity, greenIntensity, blueIntensity)
    Description: Sets a tri-color LED in the Finch beak to a given color by setting the intensities of the red, green, and blue elements inside it. The method requires three intensity values from 0-100. Setting all three intensity values to 0 turns the beak off.
    Example: myFinch.setBeak(0,100,0)

## Method Signature: setTail(port, redIntensity, greenIntensity, blueIntensity)
    Description: Sets a tri-color LED in the Finch tail to a given color by setting the intensities of the red, green, and blue elements inside it. The method requires the port number of the LED (1, 2, 3, 4, or “all”) and three intensity values from 0-100. Setting all three intensity values to 0 turns the LED off.
    Example: myFinch.setTail(“all”,0,100,0)

## Method Signature: playNote(note, beats)
    Description: Plays a note using the buzzer on the Finch. The method requires an integer representing the note (32-135) and a number giving the number of beats (0-16). The number of beats can be a decimal number. One beat corresponds to one second.
    Example: myFinch.playNote(60,0.5)

## Method Signature: setDisplay(LEDlist)
    Description: Sets the LED array of the micro:bit to display a pattern defined by a list of length 25. Each value in the list must be 0 (off) or 1 (on). The first five values in the array correspond to the five LEDs in the first row, the next five values to the second row, etc.
    Example: myFinch.setDisplay([1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1])

## Method Signature: setPoint(row, column, value)
    Description: Turn on or off a single LED on the micro:bit display. The position of the LED is given by the row and column parameters, which should both be between 1 and 5. The value of the LED must be 0 (off) or 1 (on).
    Example: myFinch.setPoint(3,3,1)

## Method Signature: print(message)
    Description: Print a string on the micro:bit LED array. The string must have 15 or fewer characters and should contain only digits and English letters (upper or lower case).
    Example: myFinch.print("hello")


# Unplanned Output Methods: 

 ## Method Signature: getDistance()
    Description: Returns the distance in centimeters to the closest object.
    Example: print("Distance to obstacle: ", myFinch.getDistance())

## Method Signature: getLight(direction)
    Description: Takes a string corresponding to a direction (‘R’ for right or ‘L’ for left) and returns the intensity measured by the corresponding Finch light sensor. The light measurement is an integer between 0 and 100 (arbitrary units).
    Example: print("Left light sensor: ", myFinch.getLight(‘L’))

## Method Signature: getLine(direction)
    Description: Takes a string corresponding to a direction (‘R’ for right or ‘L’ for left) and returns the intensity measured by the corresponding Finch line tracking sensor. The line measurement is an integer between 0 and 100 (arbitrary units).
    Example: print("Right line sensor: ", myFinch.getLine(‘R’))

## Method Signature: resetEncoders()
    Description: Sets the value of both Finch encoders to 0.
    Example: myFinch.resetEncoders()

## Method Signature: getEncoder(direction)
    Description: Takes a string corresponding to a direction (‘R’ for right or ‘L’ for left) and returns the value measured by the corresponding Finch encoder. The encoder measurement is the number of rotations that the wheel has turned since resetEncoders() was last called.
    Example: print("Right wheel rotations: ", myFinch.getEncoder(‘R’))

## Method Signature: getButton(button)
    Description: Takes a string corresponding to a micro:bit button (‘A’,‘B’, or ‘Logo’) and returns a Boolean value that is True if the button is being pressed, and False otherwise. The Logo button is only present on a micro:bit V2, so this option cannot be used with a micro:bit V1.
    Example: print("Button A is pressed: ", myFinch.getButton('A'))

## Method Signature: isShaking()
    Description: Returns True if the Finch is shaking and False otherwise.
    Example: print("Shake Status: ", myFinch.isShaking())

## Method Signature: getOrientation()
    Description: Returns a string that represents the orientation of the Finch. The possible values are “Beak up”, “Beak down”, “Tilt left”, “Tilt right”, “Level”, “Upside down”, and “In between”.
    Example: print("Orientation: " + myFinch.getOrientation())

## Method Signature: getAcceleration()
    Description: Returns a list that contains the Finch acceleration in m/s2 in the x, y, and z directions.
    Example: print("Acceleration: ", myFinch.getAcceleration())

## Method Signature: getCompass()
    Description: Returns the direction of the Finch in degrees from magnetic north (0°-359°). The compass should be calibrated in the BluemyFinch Connector before using this method.
    Example: print("Compass Heading: ", myFinch.getCompass())

## Method Signature: getMagnetometer()
    Description: Returns a list that contains the value of the magnetic field in µT in the x, y, and z directions. The compass should be calibrated in the BluemyFinch Connector before using this method.
    Example: print("Magnetic Field: ", myFinch.getMagnetometer())

## Method Signature: getSound()
    Description: Returns the sound measured by the micro:bit. The sound measurement is an integer between 0 and 100 (arbitrary units). This function can only be used with the micro:bit V2.
    Example: print("Sound: ", myFinch.getSound())

## Method Signature: getTemperature()
    Description: Returns the temperature in degrees Celsius measured by the micro:bit. This function can only be used with the micro:bit V2.
    Example: print("Temperature: ", myFinch.getTemperature())

## Method Signature: stopAll()
    Description: Stops all outputs. This includes the LED display for the micro:bit and all lights and motors for the Finch.
    Example: myFinch.stopAll()

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pseudofinch",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Quinn Pare' <quinnpare@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/8b/56/30a4e862550abc6522c60effa062957f503fb91e296894681584e565c7c3/pseudofinch-1.0.0.tar.gz",
    "platform": null,
    "description": "\r\n# PseudoFinch\r\n\r\nSimulates most functions of the BirdBrain Technologies Finch 2.0 Robot.\r\n\r\n\r\n## Documentation\r\n\r\n[Documentation](https://quarksay.github.io/PseudoFinch/)\r\n\r\n# Constructors: \r\n## Method Signature: Finch()\r\n    Description: Constructor that creates an object corresponding to a Finch.\r\n    Example: myFinch = Finch(\"Name\")\r\n\r\n# Output Methods: \r\n\r\n## Method Signature: setMove(direction, distance, speed)\r\n    Description: Moves the Finch forward or backward for a specified distance at a specified speed. The method requires a direction (\u2018F\u2019 for forward or \u2018B\u2019 for backward), a distance in centimeters, and a speed from 0-100.\r\n    Example: myFinch.setMove(\u2018F\u2019,10,50)\r\n\r\n## Method Signature: setTurn(direction, angle, speed)\r\n    Description: Turns the Finch right or left for a specified angle at a specified speed. The method requires a direction (\u2018R\u2019 for right or \u2018L\u2019 for left), an angle in degrees, and a speed from 0-100.\r\n    Example: myFinch.setTurn(\u2018R\u2019,90,50)\r\n\r\n## Method Signature: setMotors(leftSpeed, rightSpeed)\r\n    Description: Sets the Finch wheels to spin at the given speeds. The method requires two speeds between -100 and 100 for the left and right wheels. Setting the speed to 0 turns the motor off.\r\n    Example: myFinch.setMotors(-50,50)\r\n\r\n## Method Signature: stop()\r\n    deprecated :(\r\n\r\n## Method Signature: setBeak(redIntensity, greenIntensity, blueIntensity)\r\n    Description: Sets a tri-color LED in the Finch beak to a given color by setting the intensities of the red, green, and blue elements inside it. The method requires three intensity values from 0-100. Setting all three intensity values to 0 turns the beak off.\r\n    Example: myFinch.setBeak(0,100,0)\r\n\r\n## Method Signature: setTail(port, redIntensity, greenIntensity, blueIntensity)\r\n    Description: Sets a tri-color LED in the Finch tail to a given color by setting the intensities of the red, green, and blue elements inside it. The method requires the port number of the LED (1, 2, 3, 4, or \u201call\u201d) and three intensity values from 0-100. Setting all three intensity values to 0 turns the LED off.\r\n    Example: myFinch.setTail(\u201call\u201d,0,100,0)\r\n\r\n## Method Signature: playNote(note, beats)\r\n    Description: Plays a note using the buzzer on the Finch. The method requires an integer representing the note (32-135) and a number giving the number of beats (0-16). The number of beats can be a decimal number. One beat corresponds to one second.\r\n    Example: myFinch.playNote(60,0.5)\r\n\r\n## Method Signature: setDisplay(LEDlist)\r\n    Description: Sets the LED array of the micro:bit to display a pattern defined by a list of length 25. Each value in the list must be 0 (off) or 1 (on). The first five values in the array correspond to the five LEDs in the first row, the next five values to the second row, etc.\r\n    Example: myFinch.setDisplay([1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1])\r\n\r\n## Method Signature: setPoint(row, column, value)\r\n    Description: Turn on or off a single LED on the micro:bit display. The position of the LED is given by the row and column parameters, which should both be between 1 and 5. The value of the LED must be 0 (off) or 1 (on).\r\n    Example: myFinch.setPoint(3,3,1)\r\n\r\n## Method Signature: print(message)\r\n    Description: Print a string on the micro:bit LED array. The string must have 15 or fewer characters and should contain only digits and English letters (upper or lower case).\r\n    Example: myFinch.print(\"hello\")\r\n\r\n\r\n# Unplanned Output Methods: \r\n\r\n ## Method Signature: getDistance()\r\n    Description: Returns the distance in centimeters to the closest object.\r\n    Example: print(\"Distance to obstacle: \", myFinch.getDistance())\r\n\r\n## Method Signature: getLight(direction)\r\n    Description: Takes a string corresponding to a direction (\u2018R\u2019 for right or \u2018L\u2019 for left) and returns the intensity measured by the corresponding Finch light sensor. The light measurement is an integer between 0 and 100 (arbitrary units).\r\n    Example: print(\"Left light sensor: \", myFinch.getLight(\u2018L\u2019))\r\n\r\n## Method Signature: getLine(direction)\r\n    Description: Takes a string corresponding to a direction (\u2018R\u2019 for right or \u2018L\u2019 for left) and returns the intensity measured by the corresponding Finch line tracking sensor. The line measurement is an integer between 0 and 100 (arbitrary units).\r\n    Example: print(\"Right line sensor: \", myFinch.getLine(\u2018R\u2019))\r\n\r\n## Method Signature: resetEncoders()\r\n    Description: Sets the value of both Finch encoders to 0.\r\n    Example: myFinch.resetEncoders()\r\n\r\n## Method Signature: getEncoder(direction)\r\n    Description: Takes a string corresponding to a direction (\u2018R\u2019 for right or \u2018L\u2019 for left) and returns the value measured by the corresponding Finch encoder. The encoder measurement is the number of rotations that the wheel has turned since resetEncoders() was last called.\r\n    Example: print(\"Right wheel rotations: \", myFinch.getEncoder(\u2018R\u2019))\r\n\r\n## Method Signature: getButton(button)\r\n    Description: Takes a string corresponding to a micro:bit button (\u2018A\u2019,\u2018B\u2019, or \u2018Logo\u2019) and returns a Boolean value that is True if the button is being pressed, and False otherwise. The Logo button is only present on a micro:bit V2, so this option cannot be used with a micro:bit V1.\r\n    Example: print(\"Button A is pressed: \", myFinch.getButton('A'))\r\n\r\n## Method Signature: isShaking()\r\n    Description: Returns True if the Finch is shaking and False otherwise.\r\n    Example: print(\"Shake Status: \", myFinch.isShaking())\r\n\r\n## Method Signature: getOrientation()\r\n    Description: Returns a string that represents the orientation of the Finch. The possible values are \u201cBeak up\u201d, \u201cBeak down\u201d, \u201cTilt left\u201d, \u201cTilt right\u201d, \u201cLevel\u201d, \u201cUpside down\u201d, and \u201cIn between\u201d.\r\n    Example: print(\"Orientation: \" + myFinch.getOrientation())\r\n\r\n## Method Signature: getAcceleration()\r\n    Description: Returns a list that contains the Finch acceleration in m/s2 in the x, y, and z directions.\r\n    Example: print(\"Acceleration: \", myFinch.getAcceleration())\r\n\r\n## Method Signature: getCompass()\r\n    Description: Returns the direction of the Finch in degrees from magnetic north (0\u00b0-359\u00b0). The compass should be calibrated in the BluemyFinch Connector before using this method.\r\n    Example: print(\"Compass Heading: \", myFinch.getCompass())\r\n\r\n## Method Signature: getMagnetometer()\r\n    Description: Returns a list that contains the value of the magnetic field in \u00b5T in the x, y, and z directions. The compass should be calibrated in the BluemyFinch Connector before using this method.\r\n    Example: print(\"Magnetic Field: \", myFinch.getMagnetometer())\r\n\r\n## Method Signature: getSound()\r\n    Description: Returns the sound measured by the micro:bit. The sound measurement is an integer between 0 and 100 (arbitrary units). This function can only be used with the micro:bit V2.\r\n    Example: print(\"Sound: \", myFinch.getSound())\r\n\r\n## Method Signature: getTemperature()\r\n    Description: Returns the temperature in degrees Celsius measured by the micro:bit. This function can only be used with the micro:bit V2.\r\n    Example: print(\"Temperature: \", myFinch.getTemperature())\r\n\r\n## Method Signature: stopAll()\r\n    Description: Stops all outputs. This includes the LED display for the micro:bit and all lights and motors for the Finch.\r\n    Example: myFinch.stopAll()\r\n",
    "bugtrack_url": null,
    "license": "MPL2.0",
    "summary": "An emulation library inspired by the Finch 2.0 made by BirdBrain Technologies.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/quibbious/PseudoFinch",
        "Issues": "https://github.com/quibbious/PseudoFinch/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d696a1ea898d7999fe8a8a4c24fd627af17dd28180bf79ce4e039f5c2e14278d",
                "md5": "5aa509036fe6705a0e0b8fed1d74af05",
                "sha256": "7f54c819629171198849fd44d652f65cbb7ded0fd2025f34b536747bff632ed0"
            },
            "downloads": -1,
            "filename": "pseudofinch-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5aa509036fe6705a0e0b8fed1d74af05",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 12087,
            "upload_time": "2025-02-03T06:39:58",
            "upload_time_iso_8601": "2025-02-03T06:39:58.043214Z",
            "url": "https://files.pythonhosted.org/packages/d6/96/a1ea898d7999fe8a8a4c24fd627af17dd28180bf79ce4e039f5c2e14278d/pseudofinch-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8b5630a4e862550abc6522c60effa062957f503fb91e296894681584e565c7c3",
                "md5": "0e7b03c15a843ed58b2a418195a03d05",
                "sha256": "e1bce0c0654668cb8f851db2687337d543bcf6cb540d48f7a22f5eb69bd04227"
            },
            "downloads": -1,
            "filename": "pseudofinch-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0e7b03c15a843ed58b2a418195a03d05",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 12504,
            "upload_time": "2025-02-03T06:39:59",
            "upload_time_iso_8601": "2025-02-03T06:39:59.142710Z",
            "url": "https://files.pythonhosted.org/packages/8b/56/30a4e862550abc6522c60effa062957f503fb91e296894681584e565c7c3/pseudofinch-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-03 06:39:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "quibbious",
    "github_project": "PseudoFinch",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pseudofinch"
}
        
Elapsed time: 0.42975s