Skip to content

Instantly share code, notes, and snippets.

View brandoaire's full-sized avatar

Will Hart brandoaire

View GitHub Profile
@brandoaire
brandoaire / sparkbot_bash_script.sh
Last active December 30, 2015 07:39 — forked from joegoggins/spark_core_rc_car_bash_script.sh
Spark Core SparkBot Bash Script
# About
# =====
#
# Control a Spark Core remote control car with a bash script. Why not?
#
# Link to the SparkBot post on the Spark Community page belo:
#
# https://community.sparkdevices.com/t/sparkbot-manually-automatically-vacuum-your-living-room/625
#
# Install
@brandoaire
brandoaire / sparkbot_firmware.ino
Last active January 9, 2018 18:40
SparkBot Firmware that runs on the Spark Core
// SparkBot Firmware
// Began 12/4
// Last updated 12/9
//
// Firmware for controlling a Spark Core connected to a Roomba Vacuum cleaner, controlled by sparkbot_bashscript.sh
// Link to project share on Spark Community site below:
//
// https://community.sparkdevices.com/t/sparkbot-manually-automatically-vacuum-your-living-room/625
//
// Credits to http://skaterj10.hackhut.com/2013/01/22/roomba-hacking-101/ for the tips!
@brandoaire
brandoaire / question-block.ino
Created March 12, 2014 23:19
Hacking a Question Block Lamp with the Spark Core
#include <LiquidCrystal.h>
LiquidCrystal *lcd;
int lcdFunc(String command);
int temp = 0;
void setup() {
// Make sure to update these to match how you've wired your pins.
// pinout on LCD ----> [RS, EN, D4, D5, D6, D7];
@brandoaire
brandoaire / rccar-local-speedcontrol.ino
Created May 20, 2014 22:05
Alternative firmware for the RC Car that features local communication through TCP, and speed control for driving and turning
/* Globals -------------------------------------------------------------------*/
int leftMotorEnable = D1; //PWM
int rightMotorEnable = A7; //PWM
int leftMotorDir = D3;
int rightMotorDir = D4;
int dance_state = 0;
int speed_f = 0;
@brandoaire
brandoaire / rccar-listener.js
Created May 20, 2014 22:07
JS listener for local control of an RC Car with a Spark Core
var dgram = require("dgram");
var os = require('os');
var getIPAddresses = function () {
var nics = os.networkInterfaces();
var results = [];
for (var name in nics) {
if (!nics.hasOwnProperty(name)) { continue; }
var nic = nics[name];
### Keybase proof
I hereby claim:
* I am brandoaire on github.
* I am brandoaire (https://keybase.io/brandoaire) on keybase.
* I have a public key whose fingerprint is C47C B7B5 A658 0029 8366 7FC7 74CF 8149 1DBD A284
To claim this, I am signing this object:

###Power Management on the Electron Beta

Our Electron beta users have reported that in some cases the battery on the Electron discharges completely and the Electron stops working even with the USB power plugged in. Pressing the reset button does not do anything and the only way to bring it back to life is by plugging the USB out and plugging it back again.

Why does this happen? The PMIC, (Power Management IC) BQ24195, uses the USB data pins to determine if there is a computer present or a compliant USB charger at the other end. While this works on most standard computers, the PMIC has a hard time detecting some chargers and defaults back to a safe input current limit of 100mA. This current is too low for the electron to both operate and charge the battery at the same time. In the current electron beta hardware configuration, the only way to overcome this is by updating the charge rate of the battery at regular intervals. This can be accomplished by calling the following function:

Note: We must also di

// Test Firmware
void setup() {
}
void loop() {
Particle.publish("RSSI",String(Cellular.RSSI()));
delay(1000);
}