Arduino Music
What is an Arudino buzzer? An arduino buzzer is also called a piezo buzzer.
Read moreWhat is an Arudino buzzer? An arduino buzzer is also called a piezo buzzer.
Read moreThe car is controlled by a remote control with four buttons: front, back, left and right,
Read morePOV clock, consists of: Arduino nano, 8 LEDs and A3144 hall sensor. Arduino, based on information
Read moreHi, every electronics needs a multimeter, you can buy it or make it yourself at home. Today I will show
Read moreList Elements: Arduino Nano Display old i2c 0.96″ Hall Effect Sensor A3144 BreadBoard Wires
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
#include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> Adafruit_SSD1306 display(4); float value=0; float rev=0; int rpm,count=0; int oldtime=0; int time; void isr() //interrupt service routine { rev++; count++; } void setup() { display.begin(SSD1306_SWITCHCAPVCC,0x3C); display.clearDisplay(); attachInterrupt(0,isr,RISING); //attaching the interrupt } void loop() { delay(1000); detachInterrupt(0); //detaches the interrupt time=millis()-oldtime; //finds the time rpm=(rev/time)*60000; //calculates rpm oldtime=millis(); //saves the current time rev=0; attachInterrupt(0,isr,RISING); display.clearDisplay(); display.setTextSize(2); display.setCursor(0,0); display.println("COUNT"); display.setCursor(70,0); display.println(count); display.setTextSize(3); display.setTextColor(WHITE); display.setCursor(34,20); display.println("RPM:"); display.setTextSize(2); display.setCursor(40,48); display.println(rpm); display.display(); } |
You don’t have to watch TV to know what the situation is in your country. In
Read moreI am using the 1.8″ color ST7735 TFT display a lot. The reason for that is that this display is
Read moreNODEmcu is an inexpensive WiFi module that enables makers and entrepreneurs to develop
Read moreDo you want to know the current weather? This article will show
Read more
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
/* * ForbiddenBit.com * * Dice Arduino */ #define D3 3 #define D4 4 #define D5 5 #define D6 6 #define D7 7 #define D8 8 #define BUTTON 11 int ButtonValue; long DIGIT; void setup () { Serial.begin(9600); pinMode (3, OUTPUT); pinMode (D4, OUTPUT); pinMode (D5, OUTPUT); pinMode (D6, OUTPUT); pinMode (D7, OUTPUT); pinMode (D8, OUTPUT); pinMode (BUTTON, INPUT_PULLUP); randomSeed(analogRead(0)); } void loop() { ButtonValue = digitalRead(BUTTON); if (ButtonValue == LOW) { DIGIT = random(1, 6); Serial.print(DIGIT); //shuffle(); if(DIGIT == 1){ digitalWrite(D3, HIGH); } else if(DIGIT == 2){ digitalWrite (D5, HIGH); digitalWrite (D8, HIGH); } else if(DIGIT == 3){ digitalWrite (D3, HIGH); digitalWrite (D4, HIGH); digitalWrite (D5, HIGH); } else if(DIGIT == 4){ digitalWrite (D3, HIGH); digitalWrite (D5, HIGH); digitalWrite (D6, HIGH); digitalWrite (D8, HIGH); } else if(DIGIT == 5){ digitalWrite (D3, HIGH); digitalWrite (D5, HIGH); digitalWrite (D6, HIGH); digitalWrite (D7, HIGH); digitalWrite (D8, HIGH); } else if(DIGIT == 6){ digitalWrite (D3, HIGH); digitalWrite (D4, HIGH); digitalWrite (D5, HIGH); digitalWrite (D6, HIGH); digitalWrite (D7, HIGH); digitalWrite (D8, HIGH); } delay(3000); } else { digitalWrite (D3, LOW); digitalWrite (D4, LOW); digitalWrite (D5, LOW); digitalWrite (D6, LOW); digitalWrite (D7, LOW); digitalWrite (D8, LOW); } } void off() { digitalWrite (D3, LOW); digitalWrite (D4, LOW); digitalWrite (D5, LOW); digitalWrite (D6, LOW); digitalWrite (D7, LOW); digitalWrite (D8, LOW); } void shuffle() { } |