Skip to content

Instantly share code, notes, and snippets.

@leoforney
leoforney / android-update.sh
Last active August 29, 2015 14:04
A simple script to update Android and build tools
#!/bin/sh
echo "Updating Android sdk..."
(while :; do echo 'y'; sleep 2; done) | android update sdk -u
(while :; do echo 'y'; sleep 2; done) | android update sdk -u --filter android-18,extra-android-support
echo "Updated!"
sleep 1
@leoforney
leoforney / install icu4c
Last active June 24, 2017 21:51
Installing icu4c (AKA libicu) on dreamhost
#!/bin/shell
echo "Hey, I heard you want to install libicu on Dreamhost... Let me help you out! :D"
if [ ! -d "$HOME/usr/local" ]; then
mkdir -p ~/usr/local
fi
if [ -d "$HOME/icu" ]; then
echo "Removing the folder ~/icu..."
// This is the power that only has a max of 75%...
int multPower = 0.75;
// your loop statement here...
public void loop() {
// Get numeric value from gamepad1 on the left trigger, can be changeable...
float leftTriggerPressed = gamepad1.left_trigger;
if (leftTriggerPressed != 0) {
// If the left trigger is slightly to all the way pressed, set the power to a max of 45%
multPower = 0.45;
/* Copyright (c) 2014 Qualcomm Technologies Inc
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted (subject to the limitations in the disclaimer below) provided that
the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
private int spoofedZero(int zeroDegree) {
int ActualDegree = gyro.getHeading();
int degree = ActualDegree - zeroDegree;
if (degree > 360) {
degree = degree - 360;
}
if (degree < 0) {
degree = degree + 360;
}
return degree;
@leoforney
leoforney / VCNL4010.java
Created August 30, 2016 03:39
FTC Sensor help
package com.qualcomm.ftcrobotcontroller.library.devices;
import com.qualcomm.ftcrobotcontroller.library.Wire;
import com.qualcomm.robotcore.hardware.HardwareMap;
/**
* Created by Leo on 2/15/2016.
*/
public class VCNL4010 {
Wire pr;
@leoforney
leoforney / error.logcat
Created December 14, 2016 02:25
FTC Robot Controller error log
Battery Power Supply logging Daemon start!!!!!
12-13 20:21:37.640 14992-14992/? E/NEW_BHD: Cannot run on production devices!
12-13 20:21:40.780 13500-14955/? W/RobotCore: [55 aa 80 40 1e] -> [33 cc 80 40 1e]
12-13 20:21:40.780 13500-14955/? W/RobotCore: could not read Modern Robotics USB DC Motor Controller [AL00VXNM]: comm timeout on payload
12-13 20:21:40.816 263-817/? I/SFPerfTracer: triggers: (rate: 0:3) (454 sw vsyncs) (0 skipped) (0:12423 vsyncs) (1:25186)
12-13 20:21:42.667 14993-14993/? E/NEW_BHD: Battery Power Supply logging Daemon start!!!!!
12-13 20:21:42.668 14993-14993/? E/NEW_BHD: Cannot run on production devices!
12-13 20:21:44.762 2272-3475/? D/WifiStateMachine: ===> 140.86,431.61 - 138.71,380.22 - 38874,25766
12-13 20:21:46.034 13500-14957/? E/RobotCore: OpMode 'TeleOpSuperSimple' stuck in loop(). Restarting robot controller app.
12-13 20:21:46.035 13500-14957/? E/RobotCore: Begin thread dump
@leoforney
leoforney / log
Created January 3, 2017 14:31
Android build error log on Windows
including ./tools/tradefederation/Android.mk ...
build/core/tasks/tools/package-modules.mk:20: Unknown installed file for module 'perf-setup.sh'
build/core/tasks/tools/package-modules.mk:20: Unknown installed file for module 'FrameworksUtilsTests'
build/core/tasks/tools/package-modules.mk:20: Unknown installed file for module 'RecyclerViewTests'
build/core/tasks/tools/package-modules.mk:20: Unknown installed file for module 'SettingsFunctionalTests'
build/core/tasks/tools/package-modules.mk:20: Unknown installed file for module 'LauncherFunctionalTests'
build/core/tasks/tools/package-modules.mk:20: Unknown installed file for module 'perf-setup.sh'
build/core/base_rules.mk:364: warning: overriding commands for target `out/target/product/generic_x86/data/nativetest/linux-kselftest/cpu-hotplug/cpu-on-off-test.sh'
build/core/base_rules.mk:364: warning: ignoring old commands for target `out/target/product/generic_x86/data/nativetest/linux-kselftest/cpu-hotplug/cpu-on-off-test.sh'
build/core/base_rules.mk:364: warn
/**
* Raspberry Pi Doors
*
* Copyright 2016 Leo Foney
*
*/
definition(
name: "Raspberry Pi Doors",
namespace: "leoforney",
author: "Leo Forney",
import balloon3.Balloon;
import org.junit.Test;
import static org.junit.Assert.*;
/*
B1 - Max blow failed, initial isn't 0, blows while popped
B2 - Blows while balloon is popped
B3 - Correct version