Skip to content

Instantly share code, notes, and snippets.

/***************************************************
This is an example for our Adafruit 16-channel PWM & Servo driver
Servo test - this will drive 16 servos, one after the other
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/products/815
These displays use I2C to communicate, 2 pins are required to
interface. For Arduino UNOs, thats SCL -> Analog 5, SDA -> Analog 4
$background_image = get_field('background_image');
$background_pattern_url = getPatternUrl($post->ID, get_field('selected_background_pattern'), get_field('background_pattern'), $bg_color_class);
if ($background_image):
echo "<a href='" . get_the_permalink() . "' id='{$post->post_name}' class='grid-item background-image {$all_custom_classes}' data-categories='" . implode(' ',$custom_categories) . "' data-tags='" . implode(' ',$custom_tags) . "' style='background-image: url({$background_image['sizes']['medium']});";
if (get_field('repeat_background_image')):
echo "background-size:auto;background-repeat:repeat;";
endif;
echo "'>\n";
elseif ($background_pattern_url):
echo "<a href='" . get_the_permalink() . "' id='{$post->post_name}' class='grid-item {$all_custom_classes}' data-categories='" . implode(' ',$custom_categories) . "' data-tags='" . implode(' ',$custom_tags) . "'>\n";
$background_image = get_field('background_image');
$background_pattern_url = getPatternUrl($post->ID, get_field('selected_background_pattern'), get_field('background_pattern'), $bg_color_class);
if ($background_image):
echo "<a href=‘“ . get_the_permalink() . “‘> id='{$post->post_name}' class='grid-item background-image {$all_custom_classes}' data-categories='" . implode(' ',$custom_categories) . "' data-tags='" . implode(' ',$custom_tags) . "' style='background-image: url({$background_image['sizes']['medium']});";
if (get_field('repeat_background_image')):
echo "background-size:auto;background-repeat:repeat;";
endif;
echo "'>\n";
elseif ($background_pattern_url):
echo "<a href=‘“ . get_the_permalink() . “‘> id='{$post->post_name}' class='grid-item {$all_custom_classes}' data-categories='" . implode(' ',$custom_categories) . "' data-tags='" . implode(' ',$custom_tags) . "'>\n";
<div class="small-12 medium-4 columns">
<div class="editable-block">
<?php
$link = get_sub_field('link');
if( $link ):
$link_url = $link['url'];
$link_title = $link['title'];
$link_target = $link['target'] ? $link['target'] : '_self';
?>
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
// The overall fire brightness
// (this can affect both color levels and power consumption)
int brightness = 200;
// Parameter 1 = number of pixels in strip
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="https://thepage.community/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="https://thepage.community/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="https://thepage.community/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="https://thepage.community/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="https://thepage.community/apple-touch-icon-60x60.png" />
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="https://thepage.community/apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="https://thepage.community/apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="https://thepage.community/apple-touch-icon-152x152.png" />
<link rel="icon" type="image/png" href="https://thepage.communit
#include <Adafruit_NeoPixel.h>
#define ledPIN 5
#define NUM_LEDS 15
#define switchState 0
#define switchPin 8
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
#include <Adafruit_NeoPixel.h>
#define PIN 5
#define NUM_LEDS 15
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
@Kotonidesu
Kotonidesu / Egg Sister Servo Heart Loop
Created February 4, 2018 15:16
A basic way to loop multiple servos. Modified from Adafruit PWM Driver Library. (https://learn.adafruit.com/adafruit-16-channel-pwm-slash-servo-shield/using-the-adafruit-library)
/***************************************************
This is an example for our Adafruit 16-channel PWM & Servo driver
Servo test - this will drive 16 servos, one after the other
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/products/815
These displays use I2C to communicate, 2 pins are required to
interface. For Arduino UNOs, thats SCL -> Analog 5, SDA -> Analog 4
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
// The overall fire brightness
// (this can affect both color levels and power consumption)
int brightness = 200;
// Parameter 1 = number of pixels in strip