Hardware Reference
In-Depth Information
static uint8_t __attribute__ ((progmem)) neutral_
bmp[]={0x3C, 0x42, 0x95, 0x91, 0x91, 0x95, 0x42, 0x3C}
The bitmap is used to determine the LEDs that would have to be turned on
to create the smiley. For example, 0x3C (binary value: 00111100) turns on
the LEDs except for the first and last two on either ends:
matrix.clear();
matrix.setRotation(3);
matrix.drawBitmap(0, 0, smile_bmp, 8, 8, LED_ON);
matrix.writeDisplay();
The setRotation function is used to rotate the display image by 90
degrees. The drawBitmap function is used to draw the bitmap on the
display. In the drawBitmap function, the first two arguments specify
the x and y of the starting position followed by the bitmap, width,
height of the bitmap, and its color.
BlinkM
1.
We discussed the BlinkM RGB LED in Project 2 , A Raspberry WebIDE Example . The
BlinkM is used to indicate impending danger by flashing a red color in the event
of impending danger. We use the BlinkM libraries to play a flashing red script in
such scenarios:
BlinkM_playScript(script_no,0,0 );
2.
The BlinkM_playScript funcion takes the script number of the RGB LED.
The second argument is the number of repeats for the script. When the third
argument is zero, the script is played in an infinite loop.
Proximity sensor
1.
The proximity sensor is used to determine the home posiion of the arrow that is
used to point to the weather posiion. The proximity sensor used in this project is
the OSEPP Proximity Sensor Module from Parallax. The proximity sensor detects
the presence of objects and communicates this via the I2C communicaion port.
2.
Similar to the other I2C devices, we set the sensor address as follows:
const uint8_t sensorAddr = 0x20;
We turn on the sensor in the Arduino setup() method:
WriteByte(sensorAddr, 0x3, 0xFE);
The sensor's reading is read by:
ReadByte(sensorAddr, 0x0, &val)
 
Search WWH ::




Custom Search