Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ertrzyiks/golem0
Framework dedicated for Arduino
https://github.com/ertrzyiks/golem0
Last synced: about 1 month ago
JSON representation
Framework dedicated for Arduino
- Host: GitHub
- URL: https://github.com/ertrzyiks/golem0
- Owner: ertrzyiks
- License: mit
- Created: 2015-01-20T20:35:31.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-05T21:12:17.000Z (almost 10 years ago)
- Last Synced: 2024-12-07T19:35:57.027Z (about 1 month ago)
- Language: C++
- Homepage: http://ertrzyiks.github.io/golem0
- Size: 824 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# golem0
Framework dedicated for Arduino## Installation
Create folder `golem0` in `(My) Documents/Arduino/libraries/` and copy there content of `libraries` from this repo.
You can find more detailed description here: http://arduino.cc/en/Guide/Libraries
## Usage
### Code structure
```c++
#includevoid setup()
{
World::setup();
}void loop()
{
World::loop();
}void world_init()
{
//your code here
}```
### Thinking
Think is single tick of original loop with controllable non-blocking delay.
To use it, create class extending Entity, override method `onThink` and add entity to world.**Important:** make sure to call `setNextThink` to receive next think.
Example:
```c++
class MyClass : public Entity
{
MyClass : Entity()
{
this->setNextThink();
}
void onThink(long currentTime)
{
//Do something
//Schedule next think for 10ms
this->setNextThink(currentTime + 10);
}
};void world_init()
{
World::addEntity(new MyClass());
}
```