Search the Community

Showing results for tags 'atmega328'.

The search index is currently processing. Current results may not be complete.
  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HWBOX | Main
  • HWBOX | Forum
    • HwBox.gr Ανακοινώσεις & Ειδήσεις
    • News/Ειδήσεις
    • Reviews
    • The Poll Forum
    • Παρουσιάσεις μελών
  • Hardware
    • Επεξεργαστές - CPUs
    • Μητρικές Πλακέτες - Motherboards
    • Κάρτες Γραφικών - GPUs
    • Μνήμες - Memory
    • Αποθηκευτικά Μέσα - Storage
    • Κουτιά - Cases
    • Τροφοδοτικά - PSUs
    • Συστήματα Ψύξης - Cooling
    • Αναβαθμίσεις - Hardware
  • Peripherals
    • Οθόνες
    • Πληκτρολόγια & Ποντίκια
    • Ηχεία - Headsets - Multimedia
    • Internet & Networking
    • General Peripherals
  • Overclocking Area
    • HwBox Hellas O/C Team - 2D Team
    • HwBox Hellas O/C Team - 3D Team
    • Hwbot.org FAQ/Support
    • Benchmarking Tools
    • General Overclocking FAQ/Support
    • Hardware Mods
  • Software Area
    • Operating Systems
    • Drivers Corner
    • General Software
    • General Gaming
  • The Tech Gear
    • Mobile Computing
    • Smartphones
    • Tablets
    • Digital Photography & Cameras
  • Off Topic
    • Free Zone
    • XMAS Contest
  • HWBOX Trade Center
    • Πωλήσεις
    • Ζήτηση
    • Καταστήματα & Προσφορές

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


Homepage


Interests


Occupation


ICQ


AIM


Yahoo


MSN


Skype


CPU


Motherboard


GPU(s)


RAM


SSDs & HDDs


Sound Card


Case


PSU


Cooling


OS


Keyboard


Mouse


Headset


Mousepad


Console


Smartphone


Tablet


Laptop


Camera


Drone


Powerbank

Found 1 result

  1. [NEWS_IMG=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/images/news_images/hwbox4.jpg[/NEWS_IMG] Ένας λάτρης των Quiz θα μαγευτεί από το παρόν DIY κατασκευής ενός Quiz Game Show Buzzer και θα περάσει ατελείωτες ώρες γύρω του με την παρέα του. Η κατασκευή του Buzzer είναι αρκετά εύκολη μιας και έχουμε το σχέδιο (προφανώς), ενώ κοστίζει ελάχιστα (το πιο ακριβό υλικό του DIY είναι το ξύλο!). Το παιχνίδι είναι για 4 παίκτες και ουσιαστικά ο πιο γρήγορος πατάει το μεγάλο χρωματιστό κουμπί του. Στην διάρκεια αυτή κανένα άλλο κουμπί δεν λειτουργεί μέχρι ο διαχειριστής του παιχνιδιού να αποφασίσει εάν η απάντηση είναι σωστή ή λανθασμένη πατώντας ένα από τα δύο μικρά κουμπάκια στην κύρια κατασκευή. Για περισσότερες πληροφορίες μπορείτε να δείτε το YouTube βίντεο στο τέλος του DIY. Περνώντας στο αγαπημένο κομμάτι των HwBoxers, το hardware, αυτά που θα χρειαστούμε για την κατασκευή του Quiz Game Show Buzzer είναι: Rocker Switch ATmega328 Ceramic Resonator 16MHZ 5V wall adapter power supply Barrel jack Hook-up wire (Heat shrink tubing Big buttons ([url=http://www.robotshop.com/ca/en/sfe-concave-button-green.html'>green , blue, yellow, red) Some LEDs Serial 8 Characters x 7 Segment LED Display Prototyping board Tamiya connectors (male, female) Resistors (1x100ohm (for the speaker), 5x150ohm (for the leds), 6x10KOhm (for the buttons)) Push buttons (2) Speaker wire [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32903.jpg[/img_alt] Βήμα 1. Το σχέδιο του όλου εγχειρήματος! [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32904.jpg[/img_alt] Βήμα 2. Ο καλύτερος τρόπος για να φτιάξετε ένα ολόσωστο κύκλωμα είναι να φτιάξετε ένα πρωτότυπο μέσω ενός breadboard. Φυσικά μπορείτε να χρησιμοποιήσετε μόνο αυτό μόνιμα. Το ηχείο που βλέπετε, παίζει έναν ήχο, σε χαμηλή στάθμη. Τα LEDs δείχνουν τον παίκτη που παίζει. Η μικρή οθόνη δείχνει το σκορ ανάμεσα στους τέσσερις παίκτες. [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32905.jpg[/img_alt] Βήμα 3. Ο κώδικας. Η τροφή που ουσιαστικά θα δώσει ζωή στο Arduino. Για το ήχο, αρκεί να αντιγράψετε τον κώδικα #include "pitches.h", θα τον βρείτε εδώ. Το πρώτο μέρος του κώδικα: Η οθόνη της δοκιμής έχει 8 ψηφία και 7 τμήματα. (8x7segment module) // array to activate particular digit on the 8x7segment module<br>// it is the common anode of 7 segment byte digit[8] = { 0b10000000, //digit 1 from right 0b01000000, //digit 2 from right 0b00100000, //digit 3 from right 0b00010000, //digit 4 from right 0b00001000, //digit 5 from right 0b00000100, //digit 6 from right 0b00000010, //digit 7 from right 0b00000001 //digit 8 from right }; <br><p>//array for decimal number, it is the cathode, please refer to the datasheet. //therefore a logic low will activete the particular segment //PGFEDCBA, segment on 7 segment, P is the dot byte number[12] = { 0b11000000, // 0 0b11111001, // 1 0b10100100, // 2 0b10110000, // 3 0b10011001, // 4 0b10010010, // 5 0b10000010, // 6 0b11111000, // 7 0b10000000, // 8 0b10010000, // 9 0b01111111, //dot 0b11111111 //blank };</p> Σειρά έχουν οι "Σταθερές" που θα βοηθήσει στην αναγνώριση των pins εισόδου - εξόδου: const int blueLEDPin = 12; const int greenLEDPin = 11; const int redLEDPin = 10; const int yellowLEDPin = 9; const int teamPinDiff = 5; //to help with computations later< const int blueButton = 17; const int greenButton = 16; const int redButton = 15; const int yellowButton = 14; const int acceptButton = 18; const int refuseButton = 19; const int speakerPin = 8; const int latchPin = 7; //connect to RCK of 8x7segment module const int clockPin = 6; //connect to SCK of 8x7segment module const int dataPin = 5; //connect to DIO of 8x7segment module const int multiplexDelay = 1; const int dotNumber = 10; const int blankNumber = 11; Μερικές Μεταβλητές, χρήσιμες για το πρόγραμμα: int currentTeam = 0; int blueScore = 0; int greenScore = 0; int redScore = 0; int yellowScore = 0; byte blueDigit1 = number[blankNumber]; byte blueDigit2 = number[0]; byte greenDigit1 = number[blankNumber]; byte greenDigit2 = number[0]; byte redDigit1 = number[blankNumber]; byte redDigit2 = number[0]; byte yellowDigit1 = number[blankNumber]; byte yellowDigit2 = number[0]; Ύστερα είναι το στήσιμο των pin modes και της οθόνης: void setup() { pinMode(blueLEDPin, OUTPUT); pinMode(greenLEDPin, OUTPUT); pinMode(redLEDPin, OUTPUT); pinMode(yellowLEDPin, OUTPUT); pinMode(blueButton, INPUT); pinMode(greenButton, INPUT); pinMode(redButton, INPUT); pinMode(yellowButton, INPUT); pinMode(acceptButton, INPUT); pinMode(refuseButton, INPUT); pinMode(speakerPin, OUTPUT); digitalWrite(blueLEDPin, LOW); digitalWrite(greenLEDPin, LOW); digitalWrite(redLEDPin, LOW); digitalWrite(yellowLEDPin, LOW); pinMode(latchPin, OUTPUT); pinMode(clockPin, OUTPUT); pinMode(dataPin, OUTPUT); digitalWrite(latchPin, HIGH); } Το loop προστίθεται ακριβώς μετά για να ξανα-ξεκινήσει το πρόγραμμα από την αρχή: void loop() { ProgramLoop(); WriteScore(); } Μετά ο χρήστης γράφει τις λειτουργίες για να χωρίσει τον κώδικα για να είναι όλα νοικοκυρεμένα! void ProgramLoop() { if (currentTeam == 0) { if (digitalRead(blueButton) == HIGH) { currentTeam = blueLEDPin; PlayAnswerBlue(); } else if (digitalRead(greenButton) == HIGH) { currentTeam = greenLEDPin; PlayAnswerGreen(); } else if (digitalRead(redButton) == HIGH) { currentTeam = redLEDPin; PlayAnswerRed(); } else if (digitalRead(yellowButton) == HIGH) { currentTeam = yellowLEDPin; PlayAnswerYellow(); } } else { digitalWrite(currentTeam, HIGH); if (digitalRead(currentTeam + teamPinDiff) == LOW) { if (digitalRead(acceptButton) == HIGH) { PlayAccept(); IncrementScore(); } else if (digitalRead(refuseButton) == HIGH) { PlayDeny(); ResetState(); } } } } void ResetState() { currentTeam = 0; digitalWrite(blueLEDPin, LOW); digitalWrite(greenLEDPin, LOW); digitalWrite(redLEDPin, LOW); digitalWrite(yellowLEDPin, LOW); } void IncrementScore() { switch (currentTeam) { case blueLEDPin: blueScore++; if (blueScore > 9) { if (blueScore > 99) { blueScore = 0; } blueDigit1 = number[blueScore / 10]; } blueDigit2 = number[blueScore % 10]; break; case greenLEDPin: greenScore++; if (greenScore > 9) { if (greenScore > 99) { greenScore = 0; } greenDigit1 = number[greenScore / 10]; } greenDigit2 = number[greenScore % 10]; break; case redLEDPin: redScore++; if (redScore > 9) { if (redScore > 99) { redScore = 0; } redDigit1 = number[redScore / 10]; } redDigit2 = number[redScore % 10]; break; case yellowLEDPin: yellowScore++; if (yellowScore > 9) { if (yellowScore > 99) { yellowScore = 0; } yellowDigit1 = number[yellowScore / 10]; } yellowDigit2 = number[yellowScore % 10]; break; } ResetState(); } void WriteScore() { display8x7segment(digit[0], number[dotNumber]); display8x7segment(digit[0], blueDigit2); display8x7segment(digit[1], blueDigit1); display8x7segment(digit[2], number[dotNumber]); display8x7segment(digit[2], greenDigit2); display8x7segment(digit[3], greenDigit1); display8x7segment(digit[4], number[dotNumber]); display8x7segment(digit[4], redDigit2); display8x7segment(digit[5], redDigit1); display8x7segment(digit[6], number[dotNumber]); display8x7segment(digit[6], yellowDigit2); display8x7segment(digit[7], yellowDigit1); } void display8x7segment(byte digit, byte number) { digitalWrite(latchPin, LOW); shiftOut(dataPin, clockPin, MSBFIRST, digit); // clears the right display shiftOut(dataPin, clockPin, MSBFIRST, number); // clears the left display digitalWrite(latchPin, HIGH); delay(1); } void PlayAnswerBlue() { display8x7segment(digit[7], number[blankNumber]); beep(speakerPin, NOTE_C5, 100); delay(25); beep(speakerPin, NOTE_C5, 100); delay(25); beep(speakerPin, NOTE_C5, 100); } void PlayAnswerGreen() { display8x7segment(digit[7], number[blankNumber]); beep(speakerPin, NOTE_D5, 100); delay(25); beep(speakerPin, NOTE_D5, 100); delay(25); beep(speakerPin, NOTE_D5, 100); } void PlayAnswerRed() { display8x7segment(digit[7], number[blankNumber]); beep(speakerPin, NOTE_E5, 100); delay(25); beep(speakerPin, NOTE_E5, 100); delay(25); beep(speakerPin, NOTE_E5, 100); } void PlayAnswerYellow() { display8x7segment(digit[7], number[blankNumber]); beep(speakerPin, NOTE_F5, 100); delay(25); beep(speakerPin, NOTE_F5, 100); delay(25); beep(speakerPin, NOTE_F5, 100); } void PlayAccept() { display8x7segment(digit[7], number[blankNumber]); beep(speakerPin, NOTE_C5, 75); delay(10); beep(speakerPin, NOTE_D5, 75); delay(10); beep(speakerPin, NOTE_E5, 75); delay(10); beep(speakerPin, NOTE_G5, 75); delay(10); beep(speakerPin, NOTE_E5, 75); delay(10); beep(speakerPin, NOTE_G5, 75); delay(10); beep(speakerPin, NOTE_C6, 75); } void PlayDeny() { display8x7segment(digit[7], number[blankNumber]); beep(speakerPin, NOTE_A4, 1000); } void beep (unsigned char speakerPin, int frequencyInHertz, long timeInMilliseconds) //code for working out the rate at which each note plays and the frequency. { int x; long delayAmount = (long)(1000000/frequencyInHertz); long loopTime = (long)((timeInMilliseconds*1000)/(delayAmount*2)); for (x=0;x Βήμα 4. Τα πλήκτρα παίρνουν θέση. Μπορούμε να χρησιμοποιήσουμε όποιο καλώδιο θέλουμε, στο παρόν, ένα καλώδιο ηχείων. Για το housing μπορούμε να χρησιμοποιήσουμε ξύλο, πλαστικό ή ακόμη και plexiglass εάν το επιθυμούμε, αφήστε τη φαντασία να σας οδηγήσει! [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32906.jpg[/img_alt] [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32907.jpg[/img_alt] [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32908.jpg[/img_alt] [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32909.jpg[/img_alt] [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32910.jpg[/img_alt] Βήμα 5. Η κεντρική μονάδα. Αποτελείται από ένα ATmega328 με ceramic resonator που λειτουργεί στα 16 MHz. Για την τρoφοδοσία, προτείνεται μετασχηματιστής 5V. Απλώς φροντίστε να βάλετε και έναν VR (Voltage Regulator) για την ασφάλεια του ATmega328! [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32911.jpg[/img_alt] [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32912.jpg[/img_alt] [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32913.jpg[/img_alt] [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32914.jpg[/img_alt] [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32915.jpg[/img_alt] Βήμα 6. Το τελικό προϊόν είναι έτοιμο να σας δώσει αρκετές ώρες παιχνιδιού και διασκέδασης! Όπως σας προείπαμε, δέιτε το παρακάτω βίντεο για να δείτε το Quiz Game Show Buzzer σε δράση! [video=youtube;SkUGFVIhBMk] [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32916.jpg[/img_alt] [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32917.jpg[/img_alt] [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32918.jpg[/img_alt] [img_alt=DIY: Quiz Game Show Buzzer]http://www.hwbox.gr/members/2195-albums460-picture32919.jpg[/img_alt] Διαβάστε περισσότερα εδώ...