Skip to content

Instantly share code, notes, and snippets.

if (!e131.isEmpty()) {
e131_packet_t packet;
e131.pull(&packet); // Pull packet from ring buffer
if (htons(packet.universe) == UNIVERSE) {
for (int i = 0; i < NUM_PIXELS; i++) {
int j = i * 3 + 1;
pixels.setPixelColor(i, packet.property_values[j], packet.property_values[j+1], packet.property_values[j+2]);
}
pixels.show();
#!/usr/bin/python
#########
# About #
#########
# This script uses a Raspberry Pi to sense for the presense or absense of water.
# If there is water, an email is sent and a buzzer goes off.
# When it's dry again, another email is sent, and the buzzer turns off.
/*
DigitalReadSerial
Reads a digital input on pin 2, prints the result to the Serial Monitor
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/DigitalReadSerial
*/
/*
DigitalReadSerial
Reads a digital input on pin 2, prints the result to the Serial Monitor
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/DigitalReadSerial
*/
/* FreqMeasureMulti - Example with serial output
* http://www.pjrc.com/teensy/td_libs_FreqMeasure.html
*
* This example code is in the public domain.
*
* I connected PIN 4 to PIN 6, PIN 4 to PIN 10 and PIN 3 to PIN 9
* Results for Serial Output "n, 1463.99, 50.0000000000, 341520.84"
*
* Uncomment line 95 to see last value change
*
/* FreqMeasureMulti - Example with serial output
* http://www.pjrc.com/teensy/td_libs_FreqMeasure.html
*
* This example code is in the public domain.
*
* I connected PIN 4 to PIN 6, PIN 4 to PIN 10 and PIN 3 to PIN 9
* Results for Serial Output "n, 1463.99, 50.0000000000, 341520.84"
*
* Uncomment line 95 to see last value change
*
/* FreqMeasureMulti - Example with serial output
* http://www.pjrc.com/teensy/td_libs_FreqMeasure.html
*
* This example code is in the public domain.
*
* I connected PIN 4 to PIN 6, PIN 4 to PIN 10 and PIN 3 to PIN 9
* Results for Serial Output "n, 1463.99, 50.0000000000, 341520.84"
*
* Uncomment line 95 to see last value change
*
/* FreqMeasureMulti - Example with serial output
* http://www.pjrc.com/teensy/td_libs_FreqMeasure.html
*
* This example code is in the public domain.
*
* I connected PIN 4 to PIN 6, PIN 4 to PIN 10 and PIN 3 to PIN 9
* Results for Serial Output "n, 1463.99, 50.0000000000, 341520.84"
*
* Uncomment line 95 to see last value change
*
pi@mark1 ~/Raspberry-ROV/Rover_Code $ g++ -I../Libraries/socket/ -lwiringPi ../Libraries/socket/Server.o main.cpp
g++: error: ../Libraries/socket/Server.o: No such file or directory
pi@mark1 ~/Raspberry-ROV/Rover_Code $ cd ../Libraries/socket/
pi@mark1 ~/Raspberry-ROV/Libraries/socket $ ls
Client.cpp client_test.cpp java_client_test.java readme.txt server.h server_test.cpp
Client.h client_test.vcproj java_server_test.java readme.txt~ Server.h server_test.vcproj
Client.java cl.java Makefile Server.cpp Server.java socket.sln
pi@mark1 ~/Raspberry-ROV/Libraries/socket $
#!/bin/bash
# chkconfig: 2345 90 90
# description: inetmon
### BEGIN INIT INFO
# Provides: inetmon
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start the program