Posted

Specifications:
  • 4-pin Serial Peripheral Interface (SPI)
  • maximum data rate of 10Mbps
  • 125 selectable channels
  • output power (0 dBm, -6 dBm, -12 dBm or -18 dBm) can be configured through the SPI interface
  • data rate (250kbps, 1Mbps, or 2Mbps) can be configured through the SPI interface


Transmitter code:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10);  // CE, CSN
const byte address[6] = "00001";
void setup()
{
  radio.begin();
  radio.openWritingPipe(address);
  radio.stopListening();
}
void loop()
{
  const char text[] = "TESTING 1 2 3, TESTING"; //message
  radio.write(&text, sizeof(text));
  delay(1000);
}
Receiver code:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9,10);  // CE, CSN
const byte address[6] = "00001";
void setup()
{
  while (!Serial);
    Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(0, address);
  radio.startListening();
}
void loop()
{
  if (radio.available())
  {
    char text[32] = {0};
    radio.read(&text, sizeof(text));
    Serial.println(text);
  }
}

Author
Categories ,

Posted

This sensor is available in a waterproof version for outdoor use.
/* DS18B20 1-Wire digital temperature sensor with Arduino example code. More info: https://www.makerguides.com */
// Include the required Arduino libraries:
#include <OneWire.h>
#include <DallasTemperature.h>
// Define to which pin of the Arduino the 1-Wire bus is connected:
#define ONE_WIRE_BUS 2
// Create a new instance of the oneWire class to communicate with any OneWire device:
OneWire oneWire(ONE_WIRE_BUS);
// Pass the oneWire reference to DallasTemperature library:
DallasTemperature sensors(&oneWire);
void setup() {
  // Begin serial communication at a baud rate of 9600:
  Serial.begin(9600);
  // Start up the library:
  sensors.begin();
  sensors.setResolution(12);  // 750 ms
}
void loop() {
  // Send the command for all devices on the bus to perform a temperature conversion:
  sensors.requestTemperatures();
  // Fetch the temperature in degrees Celsius for device index:
  float tempC = sensors.getTempCByIndex(0); // the index 0 refers to the first device
  // Fetch the temperature in degrees Fahrenheit for device index:
  float tempF = sensors.getTempFByIndex(0);
  // Print the temperature in Celsius in the Serial Monitor:
  Serial.print("Temperature: ");
  Serial.print(tempC);
  Serial.print(" \xC2\xB0"); // shows degree symbol
  Serial.print("C  |  ");
  // Print the temperature in Fahrenheit
  Serial.print(tempF);
  Serial.print(" \xC2\xB0"); // shows degree symbol
  Serial.println("F");
  // Wait 1 second:
  delay(1000);
}

Author
Categories ,

Posted

  • Home Page
    • Quote of the Day
    • Services
    • Portfolio
      • Streamlit
      • Vue invoice
      • Hollis Equestrian Park
      • Wix website
      • Form to PDF to email
      • Arduino
  • Blog
    • Categories
    • Content
    • Links
  • Contact
    • Form
    • Categories
    • Captcha
    • Send message
  • About
    • Who I am
    • Education
    • Employment History
    • Community
    • Publications

Author

Posted
Comments 1

What do you want to do next?

  • Write a new article? Let your creativity flow!
  • Change this site’s name, slogan or select a different article URL style? Check and modify your preferences.
  • Edit or delete this article? Your articles list is the place to start.
  • Upload images or files to accompany your articles?
  • Learn Textile, the markup generator included with Textpattern? You can try it in the Textile sandbox.
    • If you want to learn more, you can refer to an extensive Textile manual.
  • Be guided through your Textpattern first steps by completing some tasks?
  • Study the Textpattern Semantic Model?
  • Add one or more additional users, or extend Textpattern’s capabilities with plugins from the Textpattern plugin directory?
  • Dive in and learn by doing? Please note:
    • When you write an article you assign it to a section of your site.
    • Sections use a page template and a style to define how site content appears in a browser.
    • Page templates typically use HTML and Textpattern tags (like this: <txp:article />) to build the output code.
    • Some Textpattern tags use forms, reusable building blocks that provide extensive control and customization over your site construction.
    • Pages, styles and forms can be packaged into themes and assigned to one or more sections.

Textpattern tags, their attributes and values are explained within the Textpattern User Documentation, where you will also find valuable examples, advice and tutorials.

There’s also a group of friendly, helpful Textpattern users and administrators at the Textpattern support forum.

Additional language translations and corrections are welcomed. Please visit Textpattern language translations for further details.

This is an example article included with Textpattern to demonstrate some of the first steps you can undertake. An example comment is associated with this article. The article and comment can be safely deleted using the articles and comments lists.

Author
Categories ,