GithubHelp home page GithubHelp logo

stephenkridel / robot-app-ble Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.75 MB

Mobile app for controlling a 5-axis robot arm. Connects to an HM-10 bluetooth tranceiver and sends serial commands to control 6 servos.

JavaScript 53.88% Starlark 2.27% Java 23.61% Ruby 3.24% Objective-C 16.69% Swift 0.31%
ble react-native robotics

robot-app-ble's Introduction

robot-app-ble

Background

This app was built to be a controller for a 5-axis robot arm. The robot arm was designed to teach children about STEM and robotics. An app was chosen as the controller of choice because it's easily extensible, accessible, and intuitive.

About this app

This app was built with bare workflow React Native and JavaScript. A main component of the app is Polidea's BLE PLX JavaScript library. This handles a lot of the Bluetooth connectivity. ConnectScreen connects to the BLE device and stores the details in a global object. MotorScreen renders components for each of the 5 different motors based on data from the constants folder. MotorScreen passes a function called sendData with arguments of the Bluetooth tranceiver's UUID information and data which are both defined in the constants folder. This sendData function sends serial data to the Arduino which is read and used to control the motors.

/screens/MotorScreen.js

const sendData = (data) => {
  device.writeCharacteristicWithoutResponseForService(UUID_1, UUID_2, data);
};

/constants/technicalSpecs.js

export const UUID_1 = '0000FFE0-0000-1000-8000-00805F9B34FB';
export const UUID_2 = '0000FFE0-0000-1000-8000-00805F9B34FB';
export const NAME_1 = 'HM-10';
export const NAME_2 = 'DSD-Tech';

/screens/ConnectScreen.js

GLOBAL_DEVICE = scanAndConnect().then((device) => {
  setIsConnected(true);
  return device;
});

Arduino code

The repo at https://github.com/stephenkridel/RobotController is the corresponding arduino code.

robot-app-ble's People

Contributors

stephenkridel avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.