Advanced Search
Search Results
136 total results found
Using Arduino Leonardo to send USB MIDI data
...r sensor. #include "MIDIUSB.h" void setup() { Serial.begin(115200 ...); } void loop() { Serial.println("Send ...roller 10 on channel 0 to 65 } void noteOn(byte channel, byte pitch ... MidiUSB.sendMIDI(noteOn); } void noteOff(byte channel, byte pitc...
How to connect a push button or switch
...hes? Buttons and switches are a way of opening and closing a circu ...ir position, they can be a good way of indicating the mode of a de ...vice, such as playing video forward or backwards. Micro switches can with mo ... ledPin 13 #define buttonPin 4 void setup() { pinMode( ledPin, OU...
How to hack a brainwave EEG toy - Force Trainer II
What is a NeuroSky Brainwave? NeuroSky Brainwave is a technology that uses EEG ...roSky chip can be found on brainwave-controlled toys such as the S ...tar Wars Force Trainer. The toy can be ...orial, we are using an UNO, hardware Serial (pins 0 & 1) is shared...
Using the serial monitor and serial logger
...e a seperate USB serial and hardware serial, and you cannot direct ...ly monitor the hardware serial [Serial1] output using ...lotter The serial plotter is a way to visually graph the data bei ...ng received, a common way to transmit multiple values is...
Using Smartphont to Read NFC tag
... involving Arduino. If you only want a simple read and write funct ... = 0x01; // 0x01 = http://www. void setup(void) { Serial.begin(115200); Se ...nt32_t versiondata = nfc.getFirmwareVersion(); if (!versiondata) ... to read RFID Serial.println("Waiting for an NFC tag..."); } vo...
How to use 7-Segment LED Backpack
... to Arduino. #include <Wire.h> void setup() { Wire.begin(); Se ... while (!Serial); // Leonardo: wait for Serial Monitor Serial.p ...rintln("\nI2C Scanner"); } void loop() { int nDevices = 0; ...done\n"); } delay(5000); // Wait 5 seconds for next scan } G...
Using a Sparkfun Sound Detector
...fun electronics that provides a way to detect ambient sound levels ...nvelope #define envelopePin A0 void setup() { Serial.begin( 9600 ...nMode( envelopePin, INPUT ); } void loop() { Serial.println( anal ...reading gate #define gatePin 2 void setup() { Serial.begin( 9600 ...
How to make Animation on NeoMatrix
... +5V to 5V GND to GND Library WarningDownload version 1.9.0 or b ...started The example shows the upward arrow first and then the anim ... colour-changing pattern. The upward arrow is for identifying the ..., 0x000, 0x0FF, }, }; void display_rgbBitmap(uint8_t bmp_n...
How to use DFPlayer mini to play MP3
...e sure you are using .mp3, not .wav or any other audio formats. #i ...nclude "SoftwareSerial.h" #include "DFRobotDFP ... // Connects to module's TX SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX) ...ct DFRobotDFPlayerMini player; void setup() { pinMode(pot, INPUT...
Controlling an actuator with TinkerKit Mosfet
...mall, cheap module which takes away all these headaches, on the Ar ...other side of your actuator) **Warning**The TinkerKit Mosfet can ... device. #define actuatorPin 6 void setup() { pinMode( actuatorPi ...n, OUTPUT ); } void loop() { digitalWrite( actuat...
Making a Force Sensor/ a Button with Velostat & Conductive Fabric
... velostat. int sensorPin = A0; void setup() { Serial.begin(9600); ... } void loop() { int sensorValue = ...uttonPin = 2; int buttonState; void setup() { // put your setup c ...e(buttonPin, INPUT_PULLUP); } void loop() { // put your main cod...
Touch sensor - with No Sensor!
...curacy without ANY external hardware. CapacitiveSensor library wil ... } return sum / SMOOTH; } void setup() { Serial.begin(9600); ...d(TOUCHPIN, RESOLUTION); } } void loop() { reading = ADCTouc ... a wire and or foil if desired void setup() { ...
How to use a Servo Motor
...e <Wire.h> ServoDriver servo; void setup() { // join I2C bus ( ...9600); servo.init(0x7f); } void loop() { // Drive 8 servos ...e <Wire.h> ServoDriver servo; void setup() { // join I2C bus ( ...rvoPulseRange(900,2100,180); } void loop() { // Drive 8 servos ...
Radio Communication: How to use APC220 Radio Data Module
... to 5V TXD to 8 RXD to 9 SoftwareSerial OnlyUse SoftwareSerial on both Arduinos. Never ...rees, one by one. #include <SoftwareSerial.h> SoftwareSerial radio(8, 9); // RX, TX ... void setup() { radio.begin(9600); ...} void loop() { radio.println("Hello...
Touch sensor - Using an MPR121
... libraries folder Now the software Arduino IDE is ready, you wil ...e.h> #define numElectrodes 12 void setup() { Serial.begin(9600); ...0); //half of TouchThreshold } void loop() { // Update touch data ...e <MPR121.h> #include <Wire.h> void setup() { Serial.begin(9600);...
How to use a Heart Beat Sensor
...// Calculated Beats Per Minute void setup() { pinMode(LED, OUTPUT ...); Serial.begin(115200); } void loop() { // Read the sensor ... signal crosses the threshold upward (beat detected) if (Signal ...ngore. // The SetUp Function: void setup() { pinMode(LED,OUTPUT)...
Arduino Nano 33 Sense Rev2- IMU sensor
...egreesX = 0; int degreesY = 0; void setup() { Serial.begin(9600); ...)); Serial.println(" Hz"); } void loop() { float x, y, z; if ...M150.h" float x,y,z, ledvalue; void setup() { if (!IMU.begin()) { ...e IMU!"); while (1); } } void loop() { // read magnetic ...
How to use a relay module
... It is handy when the thing you want to control requires higher po ... In this tutorial, I will use a water pump and a 1-channel 5V rela ... 1 channel relay to control one water pump. Labels on a Relay Modu ...- pin 3 NO - red(+) wire of the water pump COM - red(+) wire of ba...