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
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries | |
# SPDX-License-Identifier: MIT | |
# Web Bluetooth in p5js with Adafruit Circuit Playground Bluefruit (UART) | |
# https://editor.p5js.org/mjvo/sketches/vcoGZWBax | |
import board | |
import time | |
from adafruit_ble import BLERadio |
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.1/p5.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.1/addons/p5.sound.min.js"></script> |
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
""" | |
Read the Serial port to receive color data for the neopixel. | |
This uses the optional second serial port available in Circuitpython 7.x | |
Activate it in the boot.py file with the following code | |
import usb_cdc | |
usb_cdc.enable(console=True, data=True) |
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
{ | |
"title": "Some 3D Collection", | |
"desc": "This is a description of this particular collection of 3D objects.", | |
"viewer-settings": "some array of additional global model-viewer settings could go here (shadow intensity, autoplay, environment image, etc)", | |
"objects": [{ | |
"id": 2213, | |
"poster": "path/to/2213.png", | |
"src": "path/to/2213.glb", | |
"ios": "path/to.2213.usdz", | |
"hotspots": [{ |
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
// Arduino library dependencies | |
#include <SPI.h> | |
#include <WiFi101.h> | |
#include <timer.h> | |
#include <ArduinoJson.h> | |
// ************ | |
// Enter your wifi access credentials and base64 encoded Twitter API | |
// key and secret in the tab: arduino_secrets.h | |
// ************ |
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
// Arduino library dependencies | |
#include <SPI.h> | |
#include <WiFi101.h> | |
#include <timer.h> | |
#include <ArduinoJson.h> | |
// ************ | |
// Enter your wifi access credentials in the tab: arduino_secrets.h | |
// ************ | |
#include "arduino_secrets.h" |
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
/* | |
#################################################################################### | |
MQTT PubSub implementation for Feather M0 | |
For information on configuration: | |
http://mjvo.github.io/tutorials/circuits/mqtt/ | |
External libraries required (available through Arduino Library Manager): | |
- WiFi101: https://www.arduino.cc/en/Reference/WiFi101 | |
- PubSub Client by Nick O'Leary: https://pubsubclient.knolleary.net/ | |
- arduino-timer by Michael Contreras: https://github.com/contrem/arduino-timer |
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
var data = "This is a sentence!"; | |
var data2 = "This is a second sentence"; | |
function setup() { | |
createCanvas(400,400); | |
typeWriter(data, 0, 20, 30, 100); | |
typeWriter(data2, 0, 20, 50, 500); | |
} | |
function draw() { |
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
void setup() { | |
Serial.begin(9600); // initialize serial communications @ 9600 | |
} | |
void loop() { | |
int potentiometer = analogRead(A0); // read the input pin | |
int mappedPot = map(potentiometer, 0, 1023, 0, 255); // remap the pot value to fit in 1 byte | |
//Serial.write(mappedPot); // write mappedPot value to the serial port (1 byte) | |
Serial.println(potentiometer); // *or* use println to print out raw potentiometer value with newline as data separator | |
delay(1); // slight delay to stabilize the ADC |
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
// Arduino code for Redboard | |
const int ledPin = 5; // the pin that the LED is attached to | |
int incomingByte; // a variable to read incoming serial data into | |
void setup() { | |
// initialize serial communication: | |
Serial.begin(9600); // note baudrate set at 9600. Other speeds available/must be matched in P5.js options | |
// initialize the LED pin as an output: | |
pinMode(ledPin, OUTPUT); | |
} |
NewerOlder