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
#!/bin/bash | |
# Raspberry Pi microSD card benchmark script. | |
# | |
# A script I use to automate the running and reporting of benchmarks I compile | |
# for: http://www.pidramble.com/wiki/benchmarks/microsd-cards | |
# | |
# Usage: | |
# $ wget https://gist.githubusercontent.com/dlech/e922dbdc870d0e1d2c6065363c189345/raw/microsd-benchmarks.sh | |
# $ sudo bash microsd-benchmarks.sh |
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
#!/usr/bin/env python3 | |
"""Demo of useless machine using BrickPi3""" | |
import time | |
import ev3dev.brickpi as bp | |
if __name__ == '__main__': |
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
#!/bin/sh -e | |
# | |
# Copyright (c) 2013-2017 Robert Nelson <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
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
#!/usr/bin/env python3 | |
# Remote control for a dump truck | |
# Copyright 2017 David Lechner <[email protected]> | |
# | |
# Based on PS3 gamepad tutorial by Anton Vanhoucke | |
# http://www.ev3dev.org/docs/tutorials/using-ps3-sixaxis | |
import evdev | |
import evdev.ecodes as e |
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
/* | |
* gyroboy.go - translation of the LEGO Education GyroBoy program to go for ev3dev | |
* | |
* MIT License | |
* | |
* Copyright (c) 2016 David Lechner <[email protected]> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |
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
#!/usr/bin/env python3 | |
# | |
# gyroboy.py - translation of the LEGO Education GyroBoy program to python for ev3dev | |
# | |
# MIT License | |
# | |
# Copyright (c) 2016 David Lechner <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal |
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
#!/usr/bin/env python | |
# | |
# ev3dev-lang-python program for the Robot Arm H25 model that is part of | |
# the 45544 LEGO Education EV3 kit. | |
# | |
# Authors: | |
# David Lechner <[email protected]> | |
# | |
from ev3dev.ev3 import * |
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
Install the project... | |
-- Install configuration: "Debug" | |
-- Installing: /usr/local/lib/libev3devkit-0.1.so.0.2.1 | |
-- Installing: /usr/local/lib/libev3devkit-0.1.so.0 | |
-- Installing: /usr/local/lib/libev3devkit-0.1.so | |
-- Installing: /usr/local/lib/libev3devkit-0.1.a | |
-- Installing: /usr/local/include/ev3devkit-0.1.h | |
-- Installing: /usr/local/lib/pkgconfig/ev3devkit.pc | |
-- Installing: /usr/local/share/vala/vapi/ev3devkit-0.1.vapi | |
-- Installing: /usr/local/share/gir-1.0/Ev3devKit-0.1.gir |
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
#!/bin/bash | |
# This script is used to start a program from a remote terminal but have it run | |
# on a virtual terminal. openvt has to be run as root, so we use sudo for that. | |
# Then, we use sudo --user to run the actual program as the current user. We also | |
# wrap the invocation in a shell so that we can rediect stdout/stderr to the | |
# current terminal. Finally, we capture the stderr of openvt and parse it to get | |
# the tty that the program is being run on so that we can kill it later. | |
tmpfile=$(tempfile) |
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 sample is based on code from: | |
* | |
* http://stackoverflow.com/questions/16367623/using-the-linux-sysfs-notify-call | |
*/ | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> |