This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This Source Code Form is subject to the terms of the Mozilla Public | |
* License, v. 2.0. If a copy of the MPL was not distributed with this | |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
extern crate euclid; | |
extern crate gleam; | |
extern crate glutin; | |
extern crate webrender; | |
extern crate winit; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <TimerOne.h> | |
#include <SPI.h> | |
#include <Mirf.h> | |
#include <MirfHardwareSpiDriver.h> | |
#include <MirfSpiDriver.h> | |
#include <nRF24L01.h> | |
// pin macros | |
#define CLR(x,y) ( PORT ## x&=(~(1<<y)) ) | |
#define SET(x,y) ( PORT ## x|=(1<<y) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace rollingaveragernamespace { | |
RollingAverager::RollingAverager() { | |
this.buffer_index_ = 0; | |
this.buffer_ = {0}; | |
this.sum = 0; | |
} | |
long RollingAverager::Roll(long next_input) { | |
++this.buffer_index_; | |
this.buffer_index_ &= (kBufferSize - 1); |