Code Monkey home page Code Monkey logo

Comments (3)

budryerson avatar budryerson commented on July 24, 2024 1

Cool!

from tfmini-plus.

maillemaker avatar maillemaker commented on July 24, 2024

An update: I do believe the Seeduino has an independent UART as it says:

The UART in the pin function is different from the serial via USB and can be operated by Serial1.

from tfmini-plus.

maillemaker avatar maillemaker commented on July 24, 2024

OK I got it to work. My RX and TX pins were reversed.

Indeed the Seeeduino has independent serial pins, 6/7, addressed via Serial1. This is independent from the USB (Serial).

I could not get the printf functions to work so I replaced them with Serial.print and Serial.println for prototyping.


#include <TFMPlus.h>  // Include TFMini Plus Library v1.5.0
TFMPlus tfmP;         // Create a TFMini Plus object
 
                                    
void setup()
{
    Serial.begin( 115200);   // Intialize terminal serial port
    delay(20);               // Give port time to initalize
    Serial.println("Serial Monitor link established.");

    Serial.println("Inidtializing TFMPlus device on Serial 1.");
    Serial1.begin( 115200);  // Initialize TFMPLus device serial port.
    delay(20);               // Give port time to initalize
    tfmP.begin( &Serial1);   // Initialize device library object and...
                             // pass device serial port to the object.
}

// Initialize variables
int16_t tfDist = 0;    // Distance to object in centimeters
int16_t tfFlux = 0;    // Strength or quality of return signal
int16_t tfTemp = 0;    // Internal temperature of Lidar sensor chip

// Use the 'getData' function to pass back device data.
void loop()
{
    delay(50);   // Loop delay to match the 20Hz data frame rate

    tfmP.getData( tfDist, tfFlux, tfTemp);
      Serial.print("Dist: ");
      Serial.println(tfDist);   // display distance,
      Serial.print("Flux: ");
      Serial.println(tfFlux);   // display signal strength/quality,
      Serial.print("Temp: ");
      Serial.println(tfTemp);   // display temperature,

}

from tfmini-plus.

Related Issues (20)

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.