GithubHelp home page GithubHelp logo

hybotics / arduino_ls7366r Goto Github PK

View Code? Open in Web Editor NEW

This project forked from werdroid/arduino_ls7366r

0.0 1.0 0.0 3.54 MB

Synchronous use of two LS7366R decoders on Arduino env

License: Other

C++ 41.67% C 16.13% Arduino 42.20%

arduino_ls7366r's Introduction

Arduino_LS7366R

Synchronous use of two LS7366R decoders on Arduino environnement.

The goal is to provide an interface for reading two LS7366R at the same time without missing ticks for a robot having two wheels. The solution is to send the order LOAD for register CNTR into OTR via SPI with the two chips on slave mode, afterwards we can read each chip via OTR.

By Werdroid.fr

Usage

  • Wire your components with SPI to Arduino like the photo below
  • Wire the two slave lines
  • Copy LS7366R.h and LS7366R.cpp in your project from LS7366R_example
#include <SPI.h>
#include "LS7366R.h"

int slave_pin_left = 10;
int slave_pin_right = 11;

LS7366R encoders(slave_pin_left, slave_pin_right, MDR0_CONF, MDR1_CONF);

void setup() {
  Serial.begin(9600);
  encoders.reset();
}

void loop() {
  encoders.sync();
  Serial.print(encoders.left());
  Serial.print(" ");
  Serial.print(encoders.right());
  Serial.println();
  delay(100);
}

Example

This example was done with an 1x Arduino Micro, 2x LS7366R, 1x oscillator 32Mhz, 1x encoder OME-A NEMICON

Arduino LS7366R Arduino LS7366R

LS7366R provided by LCI CSI and Anaheim Automation. Encoder provided by Vicatronic.

License

MIT

Free Software, Hell Yeah!

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.