Skip to content

Instantly share code, notes, and snippets.

#include <DFRobot_DF1201S.h>
#include <SoftwareSerial.h>
// Tell Arduino which pins are wired to MP3 player (remember RX on Arduino is TX on MP3 player)
SoftwareSerial DF1201SSerial(2, 3); //Arduino RX, Arduino TX
// object that will handle all comms to MP3 player
DFRobot_DF1201S DF1201S;
void setup(void){
@rahulbot
rahulbot / motor qwiic.ino
Created February 20, 2024 19:26
Simple example of using motor driver QWIIC board from SparkFun
#include <Arduino.h>
#include <stdint.h>
#include "SCMD.h"
#include "SCMD_config.h" //Contains #defines for common SCMD register names and values
#include "Wire.h"
SCMD myMotorDriver; //This creates the main object of one motor driver and connected peripherals.
void setup()
{
/***********************************************************/
// Demo for the Serial MP3 Player Catalex (YX5300 chip)
// Hardware: Serial MP3 Player *1
// Board: Arduino UNO
// http://www.dx.com/p/uart-control-serial-mp3-music-player-module-for-arduino-avr-arm-pic-blue-silver-342439#.VfHyobPh5z0
//
// Uncomment SoftwareSerial for Arduino Uno or Nano.
#include <SoftwareSerial.h>
@rahulbot
rahulbot / neopixel-fastled-fire.ino
Created February 16, 2023 18:49
Arduino neopixel examples
#include "FastLED.h"
#define PIN_NEO_PIXEL 8 // Arduino pin that connects to NeoPixel
#define NUM_LEDS 21
CRGB leds[NUM_LEDS];
void setup() { FastLED.addLeds<NEOPIXEL, PIN_NEO_PIXEL>(leds, NUM_LEDS); }
void loop() {
@rahulbot
rahulbot / neopixel-simple.ino
Created February 16, 2023 18:29
Arduino Simple NeoPixel Example
#include <Adafruit_NeoPixel.h>
#define PIN_NEO_PIXEL 8 // Arduino pin that connects to NeoPixel
#define NUM_PIXELS 21 // The number of LEDs (pixels) on NeoPixel
#define DELAY_INTERVAL 100
Adafruit_NeoPixel NeoPixel(NUM_PIXELS, PIN_NEO_PIXEL, NEO_GRB + NEO_KHZ800);
void setup() {
@rahulbot
rahulbot / data-array-example.ino
Created February 14, 2023 20:00
Arduino data example
#include <Servo.h> // use a set of functions to control the servo
int potPosition; // keep track of the potentiometer's last value
int dataIndex; // keep track of the index of the data item we're showing
int servoPosition; // keep track of where the servo is
Servo myservo; // make a servo helper object
int SERVO_PIN = 3; // the phyiscal pin we'll attach the servo to
int data[] = {1,10,10,10,1,2,4,5,10,10,0}; // an array of made up data
{
"coord": {
"lon": -71.0589,
"lat": 42.3601
},
"weather": [
{
"id": 701,
"main": "Mist",
"description": "mist",
@rahulbot
rahulbot / center-left.csv
Created February 12, 2021 00:35
data for viz testing
date count total percentage word
2019-12-30 3 49 0.0612 bigoted
2020-01-06 3 84 0.0357 bigoted
2020-01-13 2 83 0.0241 bigoted
2020-01-20 1 137 0.0073 bigoted
2020-01-27 3 236 0.0127 bigoted
2020-02-03 4 268 0.0149 bigoted
2020-02-10 5 203 0.0246 bigoted
2020-02-17 3 286 0.0105 bigoted
2020-02-24 3 220 0.0136 bigoted
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"background": "white",
"padding": 5,
"width": 800,
"height": 300,
"style": "cell",
"data": [
{"name": "selector304_store"},
{
@rahulbot
rahulbot / itunes_to_rss.rb
Created February 19, 2020 09:33 — forked from crm114/itunes_to_rss.rb
Get RSS feeds for iTunes Podcast links
# gem install httparty
# gem install nokogiri
# gem install feedjira
require 'httparty'
require 'nokogiri'
require 'feedjira'
module ItunesToRSS
def self.extract(url)
headers = { 'User-Agent' => 'iTunes/10.1 (Windows; U; Microsoft Windows XP Home Edition Service Pack 2 (Build 2600)) DPI/96' }