Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Counter Class Reference
#include <Counter.h>
Public Member Functions | |
Counter () | |
Default Constructor. | |
void | memwrite (void) |
Write to Memory. | |
void | memread (void) |
Read from memory. | |
void | increment (int index) |
Increment count. | |
void | clear () |
Clears Count. |
Detailed Description
Counter example.
#include "mbed.h" #include "Counter.h" int main(void) { Counter ct; while (true) { ct.increment(rand()%MAX_LEN); wait(0.5); } }
Definition at line 29 of file Counter.h.
Constructor & Destructor Documentation
Counter | ( | ) |
Default Constructor.
Sets read/write memory addresss of Flash memory Also calls init()
Definition at line 8 of file Counter.cpp.
Member Function Documentation
void clear | ( | ) |
void increment | ( | int | index ) |
Increment count.
Simply increments value of index
- Parameters:
-
index Index of count array to be incremented
Definition at line 72 of file Counter.cpp.
void memread | ( | void | ) |
Read from memory.
Loads values of existiing count array from Flash Memory
Definition at line 62 of file Counter.cpp.
void memwrite | ( | void | ) |
Write to Memory.
Writes current count array to Flash Memory
Definition at line 48 of file Counter.cpp.
Generated on Mon Jul 25 2022 17:25:07 by
