Giter Site home page Giter Site logo

inteliinfra-com / melopero_amg8833 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from melopero/melopero_amg8833

0.0 1.0 0.0 231 KB

A Python3 library for interfacing the Melopero AMG8833 breakout board with a Raspberry Pi.

License: MIT License

Python 100.00%

melopero_amg8833's Introduction

Melopero AMG8833

melopero logo

Getting Started

Prerequisites

You will need:

Installing

You can install the melopero-amg8833 module by typing this line in the terminal:

sudo pip3 install melopero-amg8833

Module description

The module contains a class to easily access the AMG8833's sensor functions.

Usage

First you need to import the module in your file:

import melopero_amg8833 as mp

Then you can create a simple amg8833 object and access it's methods, the sensor object will be initialized with the i2c address set to 0x69 and the i2c bus to 1 alias (dev/i2c-1) which is the standard i2c bus in a Raspberry pi.

sensor = mp.AMGGridEye()

Alternatively you can modify it's parameters by typing

sensor = mp.AMGGridEye(i2c_addr = myaddress, i2c_bus = mybus)

The sensor has the following methods

sensor.set_fps_mode(fps_mode) #sets the fps mode there are only two options: AMGGridEye.FPS_10_MODE or AMGGridEye.FPS_1_MODE
sensor.get_fps() #returns the current fps 10 or 1
sensor.update_pixel_temperature_matrix() #updates the pixels matrix
sensor.get_pixel_temperature_matrix() #returns the last updated pixel matrix
sensor.get_pixel_temperature(x, y) #returns the spicified pixel's temperature
sensor.get_thermistor_temperature() #returns the temperature of the thermistor

Example

The following example will print out the temperature and the pixel temperature matrix every 0.1 seconds (10 fps)

import time
import melopero_amg8833 as mp

sensor = mp.AMGGridEye()
sensor.set_fps_mode(mp.AMGGridEye.FPS_10_MODE)

while(True):
    #print temperature
    print(sensor.get_thermistor_temperature())

    #update and print matrix
    sensor.update_pixel_temperature_matrix()
    print(sensor.get_pixel_temperature_matrix())

    #wait 0.1 seconds
    time.sleep(0.1)

Attention:

The module is written in python3 and by now supports only python3, remember to use always pip3 when you install the module and python3 when you run the code.

melopero_amg8833's People

Contributors

leoli51 avatar melopero avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.