Skip to content

kkiani/Dynamic-Array-for-Arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Dynamic Array for Arduino

Introduction

This is simple generic Link list for Arduino in C++, without need any requirements.

How to make object?

Since this is generic class you can set type of array in initialization. type must be defined in <>

list<int> obj;

Methods

append

append method will add new given element to the end of array.

obj.append(23);

See Also: insertStart and addNewValueAtIndex

display

this method only works on default c++ iostream, If you wants to use it in Arduino you should change it in your way.

insertStart

adding new element to top of list, You can’t use it while the list is empty.

obj.insertStart(50);

See Also: append to add first element.

addNewValueAtIndex

inserting new element to the specific position, the position must be zero index.

obj.addNewValueAtIndex(5, 60);		// adding 60 into the positon of 5

See Also: setValueForIndex

setValueForIndex

changing value of element at specific position, the position must be zero index.

obj.setValueForIndex(5, 60);		// changeing value of element at index 5 to 60

See Also: addNewValueAtIndex

valueForIndex

Returning value of element at specific position, the position must be zero index.

int foo;
foo = obj.valueForIndex(3);

See Also: setValueForIndex

deleteFirst

Deleting top of list element

obj.deleteFirst();

See Also: deleteLast and deleteValueAtIndex

deleteLast

Deleting end of list element

obj.deleteLast();

See Also: deleteFirst and deleteValueAtIndex

deleteValueAtIndex

Deleting element at specific position, position must be zero index.

obj.deleteValueAtIndex(4);

See Also: deleteLast and deleteFirst

length

Return number of element exist in the list.

int numberOfElements;
numberOfElements = obj.length();

About

Link list for Arduino.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages