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 <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
int main (void) { | |
srand(time(NULL)); | |
int currentPosition[2] = {0,0}; | |
int startRow = rand() / (RAND_MAX / (9 + 1) + 1); | |
int startColumn = rand() / (RAND_MAX / (9 + 1) + 1); | |
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
# Generated by iptables-save v1.6.2 on Tue Aug 7 00:51:28 2018 | |
*security | |
:INPUT ACCEPT [892816:236841925] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [903821:312132550] | |
COMMIT | |
# Completed on Tue Aug 7 00:51:28 2018 | |
# Generated by iptables-save v1.6.2 on Tue Aug 7 00:51:28 2018 | |
*raw | |
:PREROUTING ACCEPT [919852:238407317] |
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
bool is_prime(int number, vector<int> primes) | |
{ | |
bool is_prime {true}; | |
size_t counter {0}; | |
while (is_prime && counter < primes.size()) { | |
if (number % primes[counter] == 0) { | |
is_prime = false; | |
} | |
++counter; |
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
/* | |
Name: CurrentController.ino | |
Created: 5/23/2018 5:14:18 PM | |
Author: tomea | |
*/ | |
#include <Servo.h> | |
#include "Battery.h" | |
#include <Wire.h> | |
#include <Adafruit_ADS1015.h> |
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 "Battery.h" | |
// Initilisation function for battery class. | |
// Params: | |
// float pdFactor - factor to convert divided voltage to actual voltage. Needs to be measured manually. | |
// int averagingWindow - How many samples to use when averaging | |
// int voltagePin - Pin number for reading voltage (Must be an analog pin) | |
// int currentPin - Pin number for reading current (Must be an analog pin) | |
Battery::Battery(float pdFactor, int averagingWindow, int voltagePin, int currentPin) : pdFactor(pdFactor), averagingWindow(averagingWindow), voltagePin(voltagePin), currentPin(currentPin) { |
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
/* | |
Name: BatteryLogger.ino | |
Created: 5/14/2018 11:02:28 AM | |
Author: tomea | |
*/ | |
#include <Servo.h> | |
Servo myServo; | |
const float PD_FACTOR = 3.504943957968f; |
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
import time, serial | |
from datetime import datetime | |
ser = serial.Serial('COM17') | |
time.sleep(10) | |
path = datetime.now().strftime('%Y-%m-%d-%H%M%S') + ".log" | |
file = open(path, 'w') | |
ser.write(b'S') | |
counter = 5 | |
forwards = True |
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
cmake_minimum_required (VERSION 2.6) | |
project(HawkCell) | |
set( CMAKE_EXPORT_COMPILE_COMMANDS ON ) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") | |
set(CMAKE_BUILD_TYPE Debug) | |
find_library(read_lib readline) | |
find_library(curses_lib ncurses) | |
find_library(pthread_lib pthread) | |
find_library(rt_lib rt) | |
find_package(Boost COMPONENTS system timer chrono) |
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
execve("./HawkCell", ["./HawkCell"], [/* 25 vars */]) = 0 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
open("/lib/arm-linux-gnueabihf/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
open("/usr/lib/arm-linux-gnueabihf/libboost_system.so.1.58.0", O_RDONLY|O_CLOEXEC) = 3 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
open("/lib/arm-linux-gnueabihf/librt.so.1", O_RDONLY|O_CLOEXEC) = 3 |
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 <iostream> | |
#include <cstdlib> | |
#include <string> | |
#include<chrono> | |
#include<thread> | |
#include <boost/asio.hpp> | |
#include <boost/asio/serial_port.hpp> | |
using namespace std; |
NewerOlder