I have a new WizNet W5200 for Parallax QuickStart. I'm currently developing code to design a few "Internet of Things" items. If I have it running you should be able to see what is going on here: http://97.85.45.216:8080/ More to come as things are discovered. --- Edit: Updated IP address.
0 Comments
I have been investigating the BAM method of LED dimming. There are already many microcontroller programs written to control a LED or multiple LEDs with BAM, however I wanted to fully understand the method so I threw together some SPIN code to prove it would work. Click the Read more link for details on the code. Bit Angle Modulation or BAM for short is a method of driving LEDs and adjusting their brightness easily with a microcontroller. Here is how it works. If you want 255 levels of color you can break this into a 8-bit number. Each one of these bits is then a multiple of 2 longer than the first. The image below may help visualize what is going on. Each bit of the 8-bit number is one of the numbered boxes below. The numbers indicate the portion of the cycle the LED is on. There are 255 portions total which are broken down into groups of 128, 64, 32, 16, 8, 4, 2, & 1. Some examples will assist in explaining how this works. If we wanted 50% brightness or 1/2 of 255 = 128 the LED would be on for the 128 portion of the cycle below. If we want 62% brightness we need a value of 158, or 10011110 in binary. We would then turn the LED on for the 128, 16, 8, 4, and 2 time periods. If we wanted ~12% brightness we could use a value of 30 which would have the LED on for the 16, 8, 4, & 2 time periods. For this to work the cycle must be faster than the human eye and 120Hz is a good range to avoid any flicker. Code to make this all happen will be discussed later.
If you are ever looking for a good power source for 12 V or 5 V devices, look no further than an old PC power supply. A few simple modifications are all it takes to get one of these to provide clean 12 V and 5 V power. Most modern PC power supplies do not have real "on-off" switches and require the motherboard to tell the power supply to turn on. You can simulate this by connecting the on-off wire (usually green) to the common (usually black). If your power supply is a standard ATX supply, refer to the pinout to verify the location of these pins. You can then use the 5 V (usually red) and 12 V (usually yellow) power pins to your device. These supplies can also supply -12 V & 3.3 V (usually orange). These are also useful for some electronic devices. If you do attempt to convert your old computer power supply be very careful as there are hazardous voltages inside.
For a mobile robot, the measurement of distance is an important piece of information needed for it to help determine where it is in the world. It is also very important to keep it from running into things. Gamma can now measure the distance in front of it to the nearest object. It does this using the Ping))) sensors mounted on the front of it. Since Gamma uses the Propeller as its processor the code for the ping can be found in the OBEX. This takes the complexities of converting microseconds between pulses to lines as simple as "range := ping.Inches(PING_CENTER)" where "range" is the variable for storing the distance, and "PING_CENTER" is the IO pin that the ping is connected to. Click "Read More" to see (and download) a sample program that reads the distances from 3 pings and displays them on the terminal. Note: this requires use of the Parallax Serial Terminal library.
The Stingray platform is a robotics development platform from Parallax. I will be using this platform to expand my knowledge of robotics and explore my interests in mobile robotics and mapping. In order to do that Gamma (as every good robot needs a name) has been equipped with 3 Parallax Ping sensors. These sensors use ultrasonic pulses to measure distance to other objects. More about this as the investigation continues.
The Javelin Stamp was the first real microcontroller I used. It ran a subset of Java and was able to be programmed using standard Java based programming structures and syntax. Today I was poking around the manufactures website and noticed it no longer exists for sale. It had been EOLed a few years ago, but now it can be officially reported as retired. I have created a few different products (for example Bell Controller 1.0) that use them as the brain of the device so they will continue to live on in them. So long little Javelin Stamp, I for one will miss your simplicity and ease of use. |
AuthorJon owner AboutThis blog covers a multitude of up and coming technology, as well as how to guides, tips and tricks, and other interesting technology related items.
Archives
January 2016
Categories
All
|