Skip to content

Instantly share code, notes, and snippets.

View futureshocked's full-sized avatar

Peter Dalmaris futureshocked

View GitHub Profile
const byte led_gpio = 32; // the PWM pin the LED is attached to
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
void setup() {
ledcAttachPin(led_gpio, 0); // assign a led pins to a channel
// Initialize channels
// channels 0-15, resolution 1-16 bits, freq limits depend on resolution
();
Serial.print("Sending:");
Serial.print(message);
Serial.print(" ");
radio.write( &message, 1 );
// Now, continue listening
radio.startListening();
// Wait here until we get a response, or timeout (250ms)
@futureshocked
futureshocked / User_setup.h
Created March 2, 2020 04:30
My User_setup.h file when running Joseph's project in Visual Studio Code
// USER DEFINED SETTINGS
// Set driver type, fonts to be loaded, pins used and SPI control method etc
//
// See the User_Setup_Select.h file if you wish to be able to define multiple
// setups and then easily select which setup file is used by the compiler.
//
// If this file is edited correctly then all the library example sketches should
// run without the need to make any more changes for a particular hardware setup!
// Note that some sketches are designed for a particular TFT pixel width/height
@futureshocked
futureshocked / Arduino-rf24-dht22.ino
Created March 5, 2020 21:08
This sketch allows an Arduino to transmit DHT22 data to the Raspberry Pi * base node, using the nRF24 transceiver.
/* 1111 - The Arduino Node Sketch
* From Raspberry Pi Full Stack Raspbian
* https://app.techexplorations.com/courses/raspberry-pi-full-stack-raspbian/
*
* This sketch allows an Arduino to transmit DHT22 data to the Raspberry Pi
* base node, using the nRF24 transceiver.
* The sketch places the Arduino in low-power mode when it is not doing
* useful work.
*
*
@futureshocked
futureshocked / rf24_receiver.py
Created March 5, 2020 21:15
1120 - The Python nRF24 receiver sketch
#!/usr/bin/env python
#
# 1120 - The Python nRF24 receiver sketch
#
# From Raspberry Pi Full Stack Raspbian
# https://app.techexplorations.com/courses/raspberry-pi-full-stack-raspbian/
#
# This program will use the nRF24 module to receive data from the remote Arduino node.
#
# RECEIVER NODE
@futureshocked
futureshocked / env_log.py
Created March 5, 2020 21:30
1140 - The Python Raspberry Pi logging script with Google Sheet support
#!/usr/bin/env python
#
# 1140 - The Python Raspberry Pi logging script with Google Sheet support
#
# From Raspberry Pi Full Stack Raspbian
# https://app.techexplorations.com/courses/raspberry-pi-full-stack-raspbian/
#
# This program will send a copy of the sensor data to Google Sheet for logging.
# It will also record the same data in the local database.
#
@futureshocked
futureshocked / lab_app.py
Last active May 13, 2020 04:54
This is version 9.1 of lab_app.py. It adds support for remote Arduino node IDs.
'''
FILE NAME
lab_app.py
Version 11
1. WHAT IT DOES
This version adds support for node IDs
2. REQUIRES
* Any Raspberry Pi
@futureshocked
futureshocked / rf24_receiver_v2.py
Created March 5, 2020 22:15
This script updates version 1 with the ability to generate # IFTTT notifications
#!/usr/bin/env python
#
# This script updates version 1 with the ability to generate
# IFTTT notifications.
#
#
#
from __future__ import print_function