pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/SloCompTech/QList

/github.githubassets.com/assets/primer-70be7debc79a8eff.css" /> GitHub - SloCompTech/QList: Linked list library for Arduino · GitHub
Skip to content

SloCompTech/QList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QList

QList

Build Status Packagist

Linked list library for Arduino

Purpose of this library is to enable programmers to create lists of things

Before we can start using library, we need to include library to our sketch

  #include <QList.h>

First, we create simple list object example for ints:

  QList<int> list;

Then we can add items in list:

  list.push_front(item); // Push item at the front of the list
  list.push_back(item); // Push item at the back of the list

Items on the list can be removed:

  list.pop_front(); // Remove item at the front of the list
  list.pop_back(); // Remove item at the back of the list
  /*
    Remove item at given position
    WARNING !
    Note:
      - index starts with 0 not 1 so interval is [0,n)
      - always check if index is in valid range before you try to clear item
  */
  list.clear(index);

  list.clear(); // This removes ALL items from list

Items on the list can accessed:

  int val1 = list.front(); // Get item at the front of the list
  int val2 = list.back(); // Get item at the back of the list
  /*
    Get item at given position
    WARNING !
    Note:
      - index starts with 0 not 1 so interval is [0,n)
      - always check if index is in valid range before you try to get item
  */
  int val3 = list.at(index);
  int val3 = list.get(index);
  int val3 = list[index];

Values of items that are already in the list, can be changed:

  /*
    WARNING !
    Note:
      - always check if index is in valid range before you try to change value of item
  */
  list.at(index) = 3;
  list[index] = 3; // Same as above

Size of list can be accessed with:

  int list_size = list.size();
  int same_list_size = list.length();

You can also search for items in list:

  int pos = list.indexOf(item);
  if(pos < 0)
    Serial.println("Item not found");

Note: If item is not found function returns -1

About

Linked list library for Arduino

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy