OneSheeld fundamental library methods

This tutorial explains the fundamental functions used by OneSheeld library, like starting the communication, waiting till the application connects to the board or inserting some delay in your sketch without missing any data from the application.
Let’s start by listing them ;),

Functions:

1) begin()
2) isAppConnected()
3) waitForAppConnection()
4) delay(unsigned long)
5) isCallbacksInterruptsSet()
6) enableCallbacksInterrupts()
7) disableCallbacksInterrupts()
8) setOnSelected(void (*userFunction)(void)

 

void begin(void)

Sets serial communication baudrate at 115200 by default.

SYNTAX

OneSheeld.begin();

RETURN

None.

PARAMETERS

None.

USAGE

 

bool isAppConnected(void)

Checks if the app is still connected to the 1Sheeld board.

SYNTAX

OneSheeld.isAppConnected();

RETURN

Boolean Yes ‘1’ or No ‘0’.

PARAMETERS

None.

USAGE

 

void waitForAppConnection(void)

Hangs your sketch until the app connects to 1Sheeld board.

SYNTAX

OneSheeld.waitForAppConnection();

RETURN

None.

PARAMETERS

None.

USAGE

 

void delay(unsigned long)

Unlike Arduino’s delay, OneSheeld’s delay still listens to incoming frames, while Arduino delay Freeze the system and miss incoming data. Use OneSheeld delay if you are using any of 1Sheeld input shields.

SYNTAX

OneSheeld.delay(timeInMilliseconds);

RETURN

None.

PARAMETERS

Unsigned long number representing time in milliseconds.

USAGE

 

bool isCallbacksInterruptsSet(void)

Checks if callbacks interrupt are enabled for OneSheeld library.

SYNTAX

OneSheeld.isCallbacksInterruptsSet();

RETURN

Boolean Yes ‘1’ or No ‘0’.

PARAMETERS

None.

USAGE

 

void enableCallbacksInterrupts(void)

Enable callbacks interrupts for all shields.

SYNTAX

OneSheeld.enableCallbacksInterrupts();

RETURN

None.

PARAMETERS

None.

USAGE

 

void disableCallbacksInterrupts(void)

Disable callbacks interrupts for all shields.

SYNTAX

OneSheeld.disableCallbacksInterrupts();

RETURN

None.

PARAMETERS

None.

USAGE

 

void setOnSelected(void (userFunction)(void)

Sets a certain individual function coded by the user in the sketch to be called and runs its functionality once certain shield is selected. This is a parent function, each shield inherits this functionality to check if it was selected at the application or not,so it’s useful if you want to run certain tasks once you select that certain shield.

SYNTAX

Mic.setOnSelected(&userFunction);

RETURN

None.

PARAMETERS

&userFunction takes the physical address of your created function in the memory, and called once new data received to execute it’s functionality.

USAGE

 




Related Blogs

Arduino Robotics

Arduino Robotics Series, from a car to a robot arm

Arduino keeps standing out from the crowd of all-around development boards due too its ease of use and budget price. As a result, this has enabled almost anyone to get his own idea into life no matter how crazy or even useless to the whole world it was, except for its maker! Also, it has …

Arduino Robot Arm

How to build an Arduino Robot Arm placed on RC Car

Arduino robots are always funny and definitely more enjoyable when combined with robotic arm! And today, I will walk you through the making of a simple Arduino Robot Arm that’s made of cardboard and how you can attach it over your Arduino Bluetooth RC Car / Robot that you have made so far through this series. …

Arduino Line Following Robot

How to build an Arduino Line Following Robot using Cardboard

Arduino Line Following Robot is one of the easiest and most well-known projects that anyone can make to learn the basics of programming, electronics, and mechanics all in one project. It’s known that this project is common for most of the makers and tech students and today I am going to give it a revisit …

Arduino Obstacle Avoiding Robot

How to build an Arduino Obstacle Avoiding Robot using Cardboard

Back again with another Arduino Bluetooth RC Car tutorial but with an advanced feature that makes your car autonomous by adding ultrasonic sensors to the RC Car you have made before!. Yeah, I know that you may have seen other tutorials using ultrasonic to make the car/robot avoid obstacles ahead, but I am going to …

Arduino Bluetooth RC car

How to make an Arduino Bluetooth RC Car using Cardboard

  Cardboard crafts are one of the most popular and easy to make DIY stuff. Mixing this with the unmatchable enjoyment of RC Cars and the ease of using Arduino, I am going to show you how to make a Cardboard Arduino Bluetooth RC car that you can control via Bluetooth from your smartphone.  …

Arduino Security Camera

Arduino Security Camera System (Arduino Home Hacks #4)

Arduino Security Camera Have you ever wanted to check your home in real time? Afraid that maybe someone has stormed in, don’t remember if you shut the door or not or maybe wanna check if your Hyper-energetic dog has broken any of your dishes AGAIN!! 🙂 Then this is the perfect place for you cause today …