top of page
Search
epitrahil3232

XRelais V3.1







































The XRelais V3.1 is a new relay, which can be used in different situations to communicate with your robot. This relay has three options: High Speed, Relay 1 and Relay 2. The high speed option can be used if you need a transmitter with a max speed from 100kHz to 8MHz, whereas the modes of relay 1 and 2 are suitable for those who need a lower speed from 4kHz to 400Hz. In the first mode it transmits as usual at low frequency as specified by its parameter , while in the case of using the second option it transmits at high frequency . Once you have downloaded this software and installed all components, you should check whether everything works according to specifications . The relay is based on the Atmega32u4 (6/11/52) or Arduino Uno ( 1 /3 / 6 ) microcontroller breakout boards . As all the I2C pins are available, this relay can by connected to other devices like sensors , motor controls , ... A complete list of components required to build this project is presented below :To install the software refer to the instructions for your platform. In reference to Windows users, please follow these steps: Unfortunately it's not possible to run a with Arduino IDE as a library, as it requires an additional library from Adafruit called 'Adafruit_BT_BLE' from Adafruit . For those who do not want to use the python script below, a very simple program can be used to test the relay. In this case, the microcontroller must be programmed as an Arduino Uno with a BLE Nano from Sparkfun. Once programmed, upload the code below and run it . In this case, the code is based on a simple example that comes with Adafruit BLE library . The blocking functions have been implemented, however it is necessary to change these functions for your needs .The XRelais V3.1 has been programmed using python for its ease of use without requiring an additional library. It is also fully available on GitHub . #!/usr/bin/python # -*- coding: utf-8 -*- # Author : Piotrek M. Subieta # Title : XRelais V3.1 import microcontroller import time import adafruit_bluetooth_BLE as bt class DHT22 : def __init__ (self, pin = 5 , frequency = 300 ) : self.pin = pin self.freq = frequency def ping (delay, hz) : while True : print "[*] % s pinging" % hz time.sleep(delay) if __name__ == '__main__' : if len(sys. argv) == 3 : relais = bt.Adafruit_BLE_Relay(sys.argv [ 1 ], sys.argv [ 2 ]) else : out = bt.Adafruit_BLE_Out() on = bt.Adafruit_BLE_On() relaistemp = DHT22(on , on ) print "[*] % s on" % (relaistemp.getstate()) time.sleep( 2 ) #You can check if it is transmitting or not by using the following code .... eccc085e13

0 views0 comments

Commentaires


bottom of page