Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to create a Bitmap For a Dinosaur using PIC16F877A

dexter419

New Member
How can I create a bitmap for a dinosaur using a PIC16F877A micro controller? I am seeking detailed guidance on the steps involved, including the programming aspects and any hardware considerations, to effectively generate and display a bitmap of a dinosaur on a display connected to the PIC16F877A.
 
You already have a thread for this subject.

AND YOU STILL HAVE NOT GIVEN THE DETAILS OF THE SCREEN TO BE USED!

No one can help you without know HOW the graphics are going to be displayed.
 
is there a converter that automatically ports from arduino to XC8, or will i have to go thro each code line by line
You have to go through it, but it's a pretty straightforward process, or just take the parts you want out of it - such as the dinosaur graphics. Essentially you're converting from C++ back to C, and much of it is the same anyway.
 
its a 16x2 LCD using PIC16F877A micro controller and XC8

OK; if you study the display controller datasheet, they generally have the facility to store a few custom character bitmaps - those would allow you to store character-cell graphics for the dinosaur. You would likely need several pairs with the image offset a pixel at a time, to give smooth movement.

Being a character display rather than graphic, you cannot do anything about the blank lines between character cells.

You would need to re-draw those character positions using the appropriate custom characters (and possibly adjacent ones) each time the dinosaur or any other graphic moves.
 
Hello, I've run into a challenge in my project. I'm working on the dino chrome game where I want the dinosaur character to remain stationary on a 16x2 LCD display (PIC16F877A), while the obstacles continuously shift to the left. Unfortunately, I've hit a roadblock and could use some guidance on what steps to take next.

Below is the code I've written so far. Additionally, I've attached a header file containing functions like Lcd8_Write_Char and Lcd8_Set_Cursor.

//dino_lcd();
Lcd8_Set_Cursor(2,1);
Lcd8_Write_Char(105); //dinosaur figure for now


Lcd8_Set_Cursor(2,7);
Lcd8_Write_Char(219); //obstacle feature for now
for (int i=0; i < 5 ; i++){
__delay_ms(1000);
Lcd8_Shift_Left();
}

Lcd8_Set_Cursor(2,12);
Lcd8_Write_Char(219); // second obstacle
for (int i=0; i < 5 ; i++){
__delay_ms(1000);
Lcd8_Shift_Left();
}


}

After resolving this issue, my plan is to implement using the button on the microcontroller. I want the dinosaur character to jump from its current position on the LCD to the top row.

Any assistance or advice you can provide would be greatly appreciated. Thank you
 

Attachments

  • ee302lcd.h
    3.1 KB · Views: 84
You cannot use the shift function if you need anything to be stationary, or not without more complexity that just re-drawing the whole line (or both lines) for every update,
 
I played last night.. Using 'F' as the dino and 'r' and 'o' for the obstacles, needs optimizing.. Dino jumps for three cycles to clear the obstacle. Didn't put a collision test in, but kinda works.

I need to buffer the whole screen to stop flickering ( if I can be arsed that is. )
 
Using this code can be helpful in creating a bitmap for a dinosaur using a PIC16F877A including the programming aspects and any hardware considerations, to effectively generate and display a bitmap of a dinosaur on a display connected to the PIC16F877A


// Define the bitmap data
const. unsigned char dinosaur Bitmap[] = { // Bitmap data goes here (1bpp format )};

// Function to send bitmap data to display
void send Bitmap To Display() { // Set display coordinates send Command (SET_DISPLAY_X_START); send Command (SET_DISPLAY_Y_START);

// Send pixel data
for (int i = 0; i < size of (dinosaur Bitmap); i++) {send Data(dinosaur Bitmap);}}

void main() {
// Initialize microcontroller peripherals and display initialize Display();
// Display the bitmap send Bitmap To Display ();

while (1) { // Main program loop }}
 
Last edited:

Latest threads

New Articles From Microcontroller Tips

Back
Top