Skip to content

Instantly share code, notes, and snippets.

klalle

Block or report user

Report or block klalle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Melbus_Mitsubishi HU.ino
/* Melbus CDCHGR Emulator
* Program that emulates the MELBUS communication from a CD-changer (CD-CHGR) in a Volvo V70 (HU-xxxx) to enable AUX-input through the 8-pin DIN-contact.
* This setup is using an Arduino Nano 5v clone
*
* The HU enables the CD-CHGR in its source-menue after a successful initialization procedure is accomplished.
* The HU will remove the CD-CHGR everytime the car starts if it wont get an response from CD-CHGR (second init-procedure).
*
* Karl Hagström 2015-11-04
* mod by S. Zeller 2016-03-14
*
@klalle
klalle / Melbus_CDCHGR_Emulator.ino
Last active Jul 12, 2019
AUX Hack on Volvo HU-xxxx
View Melbus_CDCHGR_Emulator.ino
/* Melbus CDCHGR Emulator
* Program that emulates the MELBUS communication from a CD-changer (CD-CHGR) in a Volvo V70 (HU-xxxx) to enable AUX-input through the 8-pin DIN-contact.
* Tis setup is using an Arduino Nano 5v clone
*
* The HU enables the CD-CHGR in its source-menue after a successful initialization procedure is accomplished.
* The HU will remove the CD-CHGR everytime the car starts if it wont get an response from CD-CHGR (second init-procedure).
*
* Karl Hagström 2015-11-04
*
* This project went realy smooth thanks to these sources:
@klalle
klalle / EnergyMeter.pde
Created Jan 7, 2015
EnergyMeter-Processing
View EnergyMeter.pde
import processing.serial.*;
Serial myPort; // Create object from Serial class
String val; // Data received from the serial port
//print to csv-file
PrintWriter output;
long xPos = 1; // horizontal position of the graph
//int xLast[] = new int[6];
View Energy Meter Computer.cpp
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h" //Activate for NRF-debug (printf_begin(); in setup() followed by radio.printDetails();)
#define CE_PIN 9
#define CSN_PIN 10
//
// Hardware configuration
View Energy Meter Wireless.cpp
/*
Reads voltage and power from China-style energy meter and sends it to nRF24L01+.
Collecting data from meter by eavesdropping on the MOSI-line (master in slave out)
between the energy monitoring chip (ECH1560) and the main processor
Meter Arduino
GND (Brown) GND (2nd from the end of the meter-board)
VCC (3.6V) RAW (Connect to battery "+" under meter-board)
CLK (Green) D2 (INT0) (5th from the end of the meter-board)
SDO (Blue-white) D5 (6th from the end of the meter-board)
View EnergyMeter.ino
/*
Reads voltage and power from China-style energy meter.
Collecting data by eavesdropping on the MOSI-line (master in slave out)
between the energy monitoring chip (ECH1560) and the main processor*/
const int CLKPin = 2; // Pin connected to CLK (D2 & INT0)
const int MISOPin = 5; // Pin connected to MISO (D5)
//All variables that is changed in the interrupt function must be volatile to make sure changes are saved.
volatile int Ba = 0; //Store MISO-byte 1
View TCP_Server.py
import socket
import threading
import socketserver
import time
import nRF24L01p
class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
"""Thread class"""
def handle(self):
while 1:
View nRF24L01p.py
#!/usr/bin/env python3
from quick2wire.spi import *
from quick2wire.gpio import Pin
from quick2wire.gpio import In,Out,pi_header_1
import time
import TCP_Server
PAYLOAD_SIZE = 3
SMALL_PAUSE = 0.05
@klalle
klalle / nRF2401_Transmitter.c
Last active Aug 27, 2018
This is a simple code that waits for the USART interrupt, that receives the payload from the USART and then calls the send-function to broadcast the data to listening nRFs.
View nRF2401_Transmitter.c
/*
* RF_Tranceiver.c
*
* Created: 2012-08-10 15:24:35
* Author: Kalle
* Atmega88
*/
#include <avr/io.h>
#include <stdio.h>
You can’t perform that action at this time.