This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
projects:crazyradio:python_lib [2015-08-06 11:46] arnaud created |
projects:crazyradio:python_lib [2020-05-12 14:15] (current) kimberly |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | This page has deprecated and moved to the new documentation framework of the main Bitcraze website. Please go to [[https:// | ||
+ | </ | ||
====== Python Crazyradio Library ====== | ====== Python Crazyradio Library ====== | ||
Line 18: | Line 22: | ||
</ | </ | ||
- | Ths is an example on how to use the lib: | + | This is an example on how to use the lib: |
<code python> | <code python> | ||
Line 53: | Line 57: | ||
^ Returns | ^ Returns | ||
^ Description | Close the USB device. Should be called before closing the program. | | ^ Description | Close the USB device. Should be called before closing the program. | | ||
- | |||
- | == set_channel(self, | ||
- | ^ Name | '' | ||
- | ^ Parameters | ||
- | ^ Returns | ||
- | ^ Description | Set the Crazyradio channel. Channel must be between 0 and 125. Channels are spaced by 1MHz starting at 2400MHz and ending at 2525MHz. | | ||
== set_channel(self, | == set_channel(self, | ||
Line 70: | Line 68: | ||
^ Parameters | ^ Parameters | ||
^ Returns | ^ Returns | ||
- | ^ Description | Set the Crazyradio address. The address is 5 bytes long. It should be a list of 5 bytes values. | | + | ^ Description | Set the Crazyradio address. The //address// is 5 bytes long. It should be a list of 5 bytes values. | |
== set_data_rate(self, | == set_data_rate(self, | ||
Line 76: | Line 74: | ||
^ Parameters | ^ Parameters | ||
^ Returns | ^ Returns | ||
- | ^ Description | Set the Crazyradio datarate. Datarate is one of '' | + | ^ Description | Set the Crazyradio datarate. |
+ | == set_power(self, | ||
+ | ^ Name | '' | ||
+ | ^ Parameters | ||
+ | ^ Returns | ||
+ | ^ Description | Set the Crazyradio transmit power. //Power// is one of '' | ||
+ | |||
+ | == set_arc(self, | ||
+ | ^ Name | '' | ||
+ | ^ Parameters | ||
+ | ^ Returns | ||
+ | ^ Description | Set the number of retry. 0<// | ||
+ | |||
+ | == set_ard_time(self, | ||
+ | ^ Name | '' | ||
+ | ^ Parameters | ||
+ | ^ Returns | ||
+ | ^ Description | Set the time to wait for an Ack in micro seconds. 250<// | ||
+ | |||
+ | == set_ard_bytes(self, | ||
+ | ^ Name | '' | ||
+ | ^ Parameters | ||
+ | ^ Returns | ||
+ | ^ Description | Set the time to wait for an Ack in number of ack payload bytes. The Crazyradio will calculate the correct time with the currently selected datarate. | | ||
+ | |||
+ | == set_cont_carrier(self, | ||
+ | ^ Name | '' | ||
+ | ^ Parameters | ||
+ | ^ Returns | ||
+ | ^ Description | Enable or disable the continious carrier mode. In continious carrier the Crazyradio transmit a constant sinus at the currently set frequency (channel) and power. This is a test mode that can affect other 2.4GHz devices (ex. wifi) it should only be used in a lab for test purposes. | | ||
+ | |||
+ | == scan_channels(self, | ||
+ | ^ Name | '' | ||
+ | ^ Parameters | ||
+ | ^ Returns | ||
+ | ^ Description | Sends \packet\ to all channels from start to stop. Returns a list of the channels for which an ACK was received. | | ||
+ | |||
+ | == send_packet(self, | ||
+ | ^ Name | '' | ||
+ | ^ Parameters | ||
+ | ^ Returns | ||
+ | ^ Description | Sends the packet //dataOut// on the configured channel and datarate. Waits for an ack and returns a _radio_ack object that contains the ack status and optional ack payload data. | | ||
==== _radio_ack ==== | ==== _radio_ack ==== | ||
=== Fields === | === Fields === | ||
+ | |||
+ | ^ (bool) ack | At '' | ||
+ | ^ (bool) powerDet | Indicate the nRF24LU1 power detector status. See nRF24LU1 documentation for more information. | | ||
+ | ^ (int) retry | Number of retry before an ack was received | | ||
+ | ^ (tuple) data | Data payload received in the Ack packet | | ||
=== Methods === | === Methods === | ||
+ | None | ||