|
Projects
Spring 2010 Older Courses Fall 2009 Spring 2009
Fall 2008
Spring 2008
Fall 2007 HOWTOs |
IchiBoardPictures are coming! Please stand by. ![]() The Ichi Board. Driver DownloadPlease install the USB driver before plugging in your IchiBoard. If you are having driver trouble in Windows, try using the FTClean utility to clean out the drivers. Launch Sequence (How to Start up Scratch Using the Ichi-Board)Please follow these steps every time you start Scratch with the Ichi Board.
IntroductionScratch has 8 channels of information it reads from the Ichi board. They are the button, slider, microphone, light sensor, and plug-in sensors A, B, C, and D. The first four of these are built onto the board and never change. The four plug-in channels allow a variety of different sensors to be attached, further extending the capabilities of the board. The four plug-in ports are also used for the built-in accelerometer and digital inputs. Keep in mind that Scratch can only look at one sensor at a time on any channel. The Ichi board is a close cousin to the Pico board, the original sensor interface for Scratch. The Ichi board includes all of the features of the Pico board, plus a whole lot more. This page focuses on what you can do with the advanced features of the Ichi board. For an introduction to the standard features, read through Getting Started With PicoBoards Changing ChannelsAll of the plug-in ports (A, B, C, D) have three different modes, and can only be in one of these modes at a time. The modes for each port can be selected independently. The three modes are Passive, Powered, and Special. Regardless of mode, the data being read by a channel will be visible in Scratch as resistance-A, resistance-B, resistance-C, or resistance-D. Only one mode, and therefore only one data source, can be selected at a time. Passive ModeThe passive plugs are the connectors at the very bottom of the Ichi board. They use mini jack plugs, also known as mono mini headphone plugs. These ports can read any passive resistive sensor; meaning anything does does not require power and changes resistance. Common sensors are potentiometers (knobs and sliders) and buttons. To activate passive mode for a particular channel, set that channel's DIP switch to off/down and plug a jack into the corresponding passive port. Powered ModeThe powered plugs use 3-pin Hirose DF3 connectors, the same that are used on the HandyBoard Cricket and related devices. These plugs are located just above the passive ports. The powered ports can support advanced sensors that require power, as well as any sensors that can be used on the passive ports. The most common powered sensors are distance sensors, which require power to emit and measure an infrared pulse. To activate powered mode for a particular channel, set that channel's DIP switch to off/down and ensure there is nothing plugged into the corresponding passive port. Special ModeEach of the four ports (A, B, C, D) have a different special mode. Channels A, B, and C are all connected to the on-board accelerometer chip to sense motion. Channel D is an extra set of digital inputs, which can only be used with on/off switches.
To activate special mode for a particular channel, set that channel's DIP switch to on/up. Digital InputsScratch must be set to Raw Data Mode to use this feature. The digital inputs are the special mode of Channel D. When active, the Ichi Board will encode the 4 digital states into an integer using base-2. This integer is reported as Channel D in Scratch. Once in Scratch, we need to decode it back to individual binary values. Setting up the physical buttonsTo be detected, the button must connect an input pin to the ground pin. All buttons can share the same ground connection. When the button is pressed, ground should be shorted to the input pin, and the Ichi Board will detect that. You can use one, two, three, or four switches. Here's a diagram of how to hook them up. ![]() Hooking up switches to D Using Scratch to Decode the signalHere is what you need to do, in plain text notation. rD is the Resistance-D value. We use the "mod" operator and an "if/else" control structure. When a switch is "true" it means that a ground connection is detected on that pin.
In scratch, the code can look something like this: ![]() Using Raw Data ModeScratch normally formats all the sensor data it receives to the range of 0-100. This range is actually not the full resolution of the sensors. The raw data is of the range 0-1023. Unless you tell it not to, Scratch will transform the data to the smaller range, sacrificing resolution. Sometimes you want all that extra resolution. To change to Raw Mode, follow these steps:
This will cause scaling calculations to break. Any operations that depend on the old range will have to be adjusted to work with the new range. Every time you start scratch you have to repeat this process. Tools & Demo SoftwareGraphical Readout ToolThis Scratch program provides a real-time graphical display of all the input board channels. This is useful for exploring the board's capabilities as well as debugging. Analog Channel Averager SpriteThis is not an entire Scratch program, but a single sprite you can import into Scratch. Create a new sprite by clicking the "Choose new sprite from file" button, and select this file. This sprite provides a tool for smoothing out the data of an analog channel. Many analog sensors (like the accelerometer) are prone to giving data that is shaky. Smoothing is used to make the data nicer for certain applications. This sprite uses a floating average to perform smoothing. You can adjust how much data it uses for the average, allowing you to control how much smoothing is applied. When this sprite is imported into Scratch it appears as a small grey triangle. You can change the appearance however you please as it has no bearing on the operation of the sprite. The sprite's script reads from an analog sensor port, does the averaging, and stores the result in a public variable that can be used by any other sprite. This variable always has the current floating average of the analog port. When the sprite is imported, the variable "average" will automatically be created. If more than one copy of this sprite is used, you will need to create additional output variables for the additional copies to use. There are comments in the sprite to help you do this. The Analog Visualizer below uses this sprite. Analog Visualizer with SmoothingThis Scratch program plots one analog channel over time, and is great for learning about how a certain sensor works. This program also uses the Averager sprite to plot the floating average of the analog channel. IchiBoard designed and supported by Mark Sherman at the UMass Lowell Engaging Computing Lab, part of the Computer Science Department. msherman@cs.uml.edu |