Skip to content

Instantly share code, notes, and snippets.

View rbonghi's full-sized avatar
🤖
robot rock

Raffaello Bonghi rbonghi

🤖
robot rock
View GitHub Profile
@rbonghi
rbonghi / ftdi.sh
Created April 25, 2017 18:50
build FTDI module for Jetson TX2
#!/bin/sh
# Prepare to build the FTDI module the NVIDIA Jetson TX2
if [ $(id -u) != 0 ]; then
echo "This script requires root permissions"
echo "$ sudo "$0""
exit
fi
# Go to the kernel sources
cd /usr/src/linux-headers-$(uname -r)
# Get the kernel configuration file
@rbonghi
rbonghi / test_thread1.py
Created April 20, 2017 07:54
Test between thread and sigint
import threading
import time
import signal, sys
def signal_handler(signal, frame):
exitFlag = 1
print(' You pressed Ctrl+C!')
# sys.exit(0)
@rbonghi
rbonghi / i2c_test.c
Created July 24, 2015 09:15
Test i2c communication
EEPROM_read(0, &rdBuffer[0], address, rdSize, pCallback);
EEPROM_write(0, wrBuffer, address, 2, wCallback);
@rbonghi
rbonghi / line_count.c
Last active August 29, 2015 14:25
How to count a line
#define BIT_LEN 7
float line_value(int line) {
int i;
int value = 0, count = 0;
for(i=0; i < BIT_LEN; ++i) {
int mask = (1 << (i));
if((line & (mask)) == (mask)) {
value += i:
count++;