background preloader

Ultrasonic Distance Measurement Using Python – Part 1

Ultrasonic Distance Measurement Using Python – Part 1
LEDs, buzzers and switches are the most common items people attempt to interface to their Raspberry Pi’s. Something I found in eBay that is a little bit different is an ultrasonic measurement module. This allows you to measure the distance to the nearest wall or solid object. The modules are easy to buy, cheap and relatively straight forward to interface to the GPIO header. So here is some information on my experiments with an Ultrasonic measurement module and Python. In future projects I can see these modules being a great way to add some intelligence to a Pi powered robot or car. The HC-SR04 module cost approximately £3 ($5) and is the size of a box of matches. Connecting To The Pi Powering the module is easy. The input pin on the module is called the “trigger” as it is used to trigger the sending of the ultrasonic pulse. You can use any GPIO pins you like on your RPi but you will need to note the references and amend your Python script accordingly. Ultrasonic Module Circuit Python Script

Free Computer Science Logo | Lesson Hacker We’ve completed our transition to a fully fledged Computer Science department at my school, as part of this we took rebranding seriously and as we’ve created some really outstanding department brand identity. I felt that it was the right time to share this with other people planning on a rebrand of their ICT departments for the brave new world of Computer Science. I’m excited by Computer Science; that was what I studied for my degree, but most people don’t understand the difference. The rebrand really had the effect of people asking us, genuinely, “What’s the difference between this and ICT?” which is a really powerful buy-in from students, colleagues and parents. The following two images are high-resolution enough to be useful for anyone, and you can feel free to use them and abuse them as you like – I’m putting them under a CC licence. And there’s even a cracking icon for you to use!

Quickly Convert Binary to Decimal in Your Head | zenoli.net [Update, April 13, 2007: Thanks to Herr Ziffer for catching a confusing typographical error.] I can’t believe I’d never seen (or figured out) this quick method for converting a binary number to a decimal number in your head. All you need to be able to do is double numbers and occasionally add one. Start at the first ’1′ on the left, and start with the mental number oneMove one digit right. Here’s an example. 1011010 – We start at the first one. The rest of this post is a little more technical, so if you glazed over when reading the above, it now may be time to soothe your tired mind. I happened across this trick while contemplating a three-state discrete finite automaton that identifies binary numbers divisible by three. For even more fun, the regular expression (0*(1(01*0)*1)*)* will also match binary numbers divisible by three. Exciting!

The binary behind algorithms The Digital Schoolhouse and Langley Grammar School’s ICT Department has embraced the teaching of computing by launching a binary behind algorithms lesson. This lesson introduces pupils to the basics of 'algorithms' and 'programming' required to cover the KS2 Points of Study in the proposed Department for Education curriculum. Pupils are intoduced to the terminology using a range of audio, visual and kinethatic learning activities e.g. Welcome to RoboMind.net, the new way to learn programming STEM Lesson: Using MIT App Inventor in the Classroom MIT’s App Inventor is a browser-based platform that allows anyone, including your students, to create mobile apps for android based devices. Computer programming is a high level STEM subject requiring the integration of skills in multiple core areas. Using programming to create applications for the devices that students have in their pockets makes computer science relevant, rewarding and fun-as well as potentially profitable. Discussion/Introduction: Some of the students may have smart phones in their possession, and this is a good chance for them to show off a bit. Have them talk about apps they find useful, things they got rid of and so on. Would students like to create their own app and possibly get compensated in real money? The most difficult part of this is starting off with an idea for an app: what functionality is missing, should be improved, or could be integrated, into a phone? Getting Started With App Inventor These video based activities are self directed and self paced.

The physics of Angry Birds: how it works We're sure, without a doubt, that you know Angry Birds. We're equally sure that you've played it - it's available for purchase on innumerable device platforms, and even for free on Google Chrome and Android, albeit with annoying ads. And we're pretty certain you're better at it than we are. Just in case, the basic plot of the game is to knock out a bunch of green pigs by firing flightless birds at them from a catapult. The birds are angry because the pigs have stolen their eggs, and the pigs are trying to protect themselves by hiding in some remarkably ramshackle structures made of wood, glass, or rock. Put baldly like that it doesn't seem like much, but in reality it's quite addictive. We make judgments about how the momentum of the red bird will be transferred to the planks and sheets of glass from our familiarity with colliding snooker balls. Exploring velocity So how did the developers at Rovio, the company that produces Angry Birds, write such realistic interactions into the game?

Algorithm An algorithm is a step-by-step list of directions that need to be followed to solve a problem. The instructions should be simple enough such that each step can be done without thinking about it. Algorithms are often used to describe how a computer might solve a problem. But there are algorithms in the real world too. A recipe can be considered a type of algorithm. Comparing algorithms[change | edit source] There is usually more than one way to solve a problem. In cooking, some recipes are more difficult to do than others, because they take more time to finish or have more things to keep track of. Sorting by colors[change | edit source] This is an example of an algorithm for sorting cards with colors on them into piles of the same color: Sorting by numbers[change | edit source] These are examples of algorithms for sorting a stack of cards with many different numbers, so that the numbers are in order. Players start with a stack of cards that have not been sorted. First pass: ( 5 1 4 2 8 )

Binary Game Skip to Content | Skip to Footer Cisco Binary Game The Cisco Binary Game is the best way to learn and practice the binary number system. It is great for classes, students and teachers in science, math, digital electronics, computers, programming, logic and networking.

Related: