Guess the magic number python script for controlling LEDs with Raspberry Pi GPIO
Used material:
1x Raspberry Pi model B 512mb
1x Breadboard
3x LED (Red, Green, Yellow)
3x 220ohm resistors
Jumper wires
Female terminal connector for GPIO pins
The following program was made to guess a number between 0 and 999, and if your guess is higher than the defined "magic number" it will blink the Red LED five times, if your guess is lower than the "magic number" it will blink thje green LED five times and if you guess the magic number defined as 321, all the 3 LEDs will blink five times.
Python script: https://drive.google.com/file/d/0ByFgW1BKyIt0cnIxYlpRa3F6MFU/edit?usp=sharing
Hand written wiring diagram: https://drive.google.com/file/d/0ByFgW1BKyIt0R0RLcDBGcGhyLUk/edit?usp=sharing
Update(25/05/2014)
Wiring diagram update: https://drive.google.com/file/d/0ByFgW1BKyIt0UjVaMzBkd0ZiYjg/edit?usp=sharing
UPDATE (25/05/2014)
I made a bit of modification in the code so now that when running the program if you choose the magic number defined as 321, all the 3 LEDs will blink at the same time instead of one after the other. The updated Python script is here : https://drive.google.com/file/d/0ByFgW1BKyIt0WDZrZ190Ulc2S2M/edit?usp=sharing
Hope you like it. Tested and running :)
UPDATE (03/06/2014)
This program is now running with a bit of code modification to make it run more properly, only by changing the order of the variables, that make the guessed number if lower than 321 will blink the yellow LED and the green LED five times. And if the guess is higher than 321 it will blink the yellow LED and the red LED five times.
Please share and comment for new ideas. Thank you!
The code is here: https://drive.google.com/file/d/0ByFgW1BKyIt0WmlxNW1jdTR1Ykk/edit?usp=sharing
Note: In the wiring diagram is written the pin numbers as the same GPIO number, nevermind that, keep in focus that we are using pin 6 for ground, and pins 7, 11, and 13 as outputs.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Guess the magic number python script for controlling LEDs with Raspberry Pi GPIO», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.