- Define constants for pins e.g.
#define LED_RED 9 - Instantiate
hueRotart,saturationRotaryandbluetoothsoftware serial - Run
void setup() { ... }- Run startup sequence
R => G => B => GB => RB => RG => RGB(helps with checking if colors are hooked up correctly - Begin listening for bluetooth serial on
9600rate - Begin listening for
hueRotataryandsaturationRotary - Setup brightness controls pins
VALUE_INCREASEandVALUE_DECREASEtoINPUT_PULLUPto avoid faulty readings
- Run startup sequence
- Run
void loop() { ... }in loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| item | price | description | |
|---|---|---|---|
| Concrete | 25 PLN (~7$) | 5 kilograms of fast-dry (1h) concrete. We used about one-third of it. | |
| Wood | 40 PLN (~10$) | I bought some low-quality pine planks, which we later painted. I recommend investing a bit more in a better type of wood if you can. | |
| MOSFET x 3 | 4.50 PLN (~1.20$) | Model: N-MOSFET IRFZ44N - THT | |
| 5V Stabilizer x 1 | 1.5 PLN (~0.40$) | ||
| ATmega328 x 1 | 12 PLN (~3.23$) | Model: ATmega328P-U DIP AVR | |
| Rotary Encoder x 2 | 6.60 PLN (~1.80$) | With pressable button, 20-pulse 12mm - EC11 vertical | |
| Knob for Encoder x 2 | 2.40 PLN (~0.70$) | model: GCL15 silver - 6/15mm | |
| Power Supply x 1 | 8.90 PLN (~2.40$) | model: 12V / 1,4A - DC 5,5 / 2,5mm | |
| DC Socket 5.5x2.1 mm | 1 PLN (~0.30$) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { WebClient } = require('@slack/client'); | |
| const fetch = require("node-fetch"); | |
| const API_URL = 'http://ron-swanson-quotes.herokuapp.com/v2/quotes'; | |
| const CHANNEL_ID = 'D6X9SM885'; | |
| module.exports = async (context, cb) => { | |
| const [quote] = await fetch(API_URL).then(res => res.json()); | |
| const { chat } = new WebClient(context.secrets.SLACK_TOKEN); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <container> | |
| <style> | |
| .columns { | |
| border: 1px solid #333; | |
| } | |
| </style> | |
| <row> | |
| <columns small="6" large="4">4 columns, 6 columns on small</columns> | |
| <columns small="6" large="8">8 columns, 6 columns on small</columns> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <mjml> | |
| <mj-head> | |
| <mj-title>My Title</mj-title> | |
| <mj-attributes> | |
| <mj-class | |
| name="text" | |
| font-family="Open Sans, Arial" | |
| color="#111111" | |
| font-size="16px" | |
| line-height="26px"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { MongoClient } = require('mongodb'); | |
| const DB_URL = process.env.DB_URL || 'mongodb://localhost:27017'; | |
| const DB_NAME = 'serverless-smoothielicious'; | |
| function errorResponse(callback, err) { | |
| console.error(err); | |
| callback(null, { | |
| statusCode: 500, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require("dotenv").config(); // read .env file if present. | |
| const nodemailer = require("nodemailer"); | |
| const createHtmlMail = require("./modules/mail-template"); // this function returns html email code | |
| exports.handler = function(event, context, callback) { | |
| const user = process.env.MAIL_USER; // [email protected] | |
| const pass = process.env.MAIL_PASSWORD; // 42isthecoolestnumber | |
| let transporter = nodemailer.createTransport({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| backend: | |
| name: git-gateway | |
| branch: master | |
| media_folder: static/img | |
| public_folder: /img | |
| collections: | |
| - name: "blog" | |
| label: "Blog" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const soundObject = new Expo.Audio.Sound(); | |
| try { | |
| await soundObject.loadAsync(require('./assets/sounds/hello.mp3')); | |
| await soundObject.playAsync(); | |
| // Your sound is playing! | |
| } catch (error) { | |
| // An error occurred! | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { AudioRecorder, AudioUtils } from 'react-native-audio'; | |
| let audioPath = AudioUtils.DocumentDirectoryPath + '/test.aac'; | |
| AudioRecorder.prepareRecordingAtPath(audioPath, { | |
| SampleRate: 22050, | |
| Channels: 1, | |
| AudioQuality: "Low", | |
| AudioEncoding: "aac" | |
| }); |
NewerOlder