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 <SPP.h> | |
USB Usb; | |
BTD Btd(&Usb); | |
SPP SerialBT(&Btd); | |
char val[3]; | |
int pin1 = 22; | |
int pin2 = 24; | |
int pin3 = 26; |
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
#define PWM_FREQUENCY 20000 // The motor driver can handle a pwm frequency up to 20kHz | |
#define PWMVALUE F_CPU/PWM_FREQUENCY/2 // Frequency is given by F_CPU/(2*N*ICR) - where N is the prescaler, we use no prescaling so frequency is given by F_CPU/(2*ICR) - ICR = F_CPU/PWM_FREQUENCY/2 | |
const uint8_t direction1 = 9; | |
const uint8_t direction2 = 10; | |
const uint8_t pwm1 = 11; | |
const uint8_t pwm2 = 12; | |
void setup() { | |
Serial.begin(115200); |
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
// Define these variables | |
int16_t accY; | |
int16_t accZ; | |
int16_t gyroX; | |
unsigned long timer; | |
// Put this in your setup() | |
Wire.begin(); | |
i2cWrite(0x6B,0x00); // Disable sleep mode | |
if(i2cRead(0x75,1)[0] != 0x68) { // Read "WHO_AM_I" register |
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
lineDist = 0.2 | |
irDist = 0.25 | |
gateDist = 0.35 | |
gateLength = 0.55 | |
gateFoundDist = 0.2 | |
%%%%%%%%%%%%% Husk at ændre!!!! | |
whiteLineValue = 0.70 | |
%%%%%%%%%%%%% |
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
/* | |
Example sketch for the RFCOMM/SPP Bluetooth library - developed by Kristian Lauszus | |
For more information visit my blog: http://blog.tkjelectronics.dk/ or | |
send me an e-mail: [email protected] | |
*/ | |
#include <Adafruit_MAX31855.h> | |
#include <SPP.h> | |
USB Usb; | |
BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so |
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
avrdude -p m644 -c usbasp -t | |
avrdude> write eeprom 0x00 0x00 0x20 0x41 0x00 0x00 0x80 0x3f 0x00 0x00 0x40 0x40 0x00 0x00 0x35 0x43 | |
avrdude> dump eeprom 0 15 |
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
package com.tkjelectronics.balanduinoapp; | |
import java.io.DataInputStream; | |
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import javax.bluetooth.DiscoveryAgent; | |
import javax.bluetooth.LocalDevice; | |
import javax.microedition.io.StreamConnection; |
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 | |
import serial | |
import time | |
import os | |
import sys | |
from string import Template | |
if os.geteuid() != 0: # Source: https://gist.github.com/davejamesmiller/1965559 | |
os.execvp("sudo", ["sudo"] + sys.argv) |
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
diff --git a/Firmware/Balanduino/Balanduino.h b/Firmware/Balanduino/Balanduino.h | |
index 338024d..45039f1 100644 | |
--- a/Firmware/Balanduino/Balanduino.h | |
+++ b/Firmware/Balanduino/Balanduino.h | |
@@ -189,6 +189,12 @@ uint32_t spekConnectedTimer; // Timer used to check if the connection is dropped | |
#define RC_CHAN_AUX4 7 | |
#endif | |
+uint8_t resetFlags __attribute__ ((section(".noinit"))); // Source: https://code.google.com/p/optiboot/issues/attachmentText?id=66&aid=660004000&name=resetFlags_appCode.cpp | |
+void resetFlagsInit(void) __attribute__ ((naked)) __attribute__ ((section (".init0"))); |
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
diff --git a/PS4BT.h b/PS4BT.h | |
index 3c0aae1..b85db8c 100644 | |
--- a/PS4BT.h | |
+++ b/PS4BT.h | |
@@ -21,6 +21,53 @@ | |
#include "BTHID.h" | |
#include "PS4Parser.h" | |
+/* | |
+const uint32_t crc32_table[] PROGMEM = { |
OlderNewer