4458 views|5 replies

1

Posts

0

Resources
The OP
 

Jing Siwei, Fu Yun, Pu Zhuoshi - Jump Jump Physics Plug-in [Copy link]

 
This post was last edited by bqgup on 2018-9-11 12:06
A physical jump plug-in based on the 51 single-chip microcomputer
Jing Siwei, Fu Yun, Pu Zhuoshi
As a clumsy person, I have always been tortured by the WeChat jump. After reading other people’s posts, I made a program to play WeChat jump, and then assisted myself in playing games. Then I took the opportunity of the qualifiers to make one myself.
System Hardware Selection and Design
1.51 Minimum System Board
255)]
2.Servo
[font =Tahoma]
3
.Capacitive pen
[back color=rgb(255, 255, 255)]This work requires relatively few components
[img= 107,17]https://en.eeworld.com/bbs/static/image/hrline/line7.png[/img]
[ /align]
Let's take a look at the program.
[ /color]
[color =#003000]

#include
#define uint unsigned int #define uchar unsigned char typedef unsigned int u16; typedef unsigned char u8; #define GPIO_KEY P1 sbit pwm=P0^1; sbit led=P2^0; int i=0; int x=87; uchar y ; u8 code time[]={40,47,50,55,60,63,71,77,79,82,85,90,95,97,100,103};

[p=30, 2, left ]void delay(unsigned char i)//delay{ unsigned char j,k; for(j=i;j>0;j--) for(k=125;k>0;k--); }

void Time0_Init() //Timer 0 initializes and sends pwm wave { TMOD|=0x01; TH0=0xFF; TL0=0x38; EA=1; ET0=1; TR0=1; }

[p =30, 2, left] void Time1_Init() //Timer 1 initializes and changes the duty cycle { TMOD|=0x10; TH1=0xD8; TL1=0xF0; EA=1; ET1=1; TR1=0; }

void KeyDown(void)//Matrix key { char a=0; GPIO_KEY=0x0f; if(GPIO_KEY!=0x0f)//Read Check if the button is pressed { delay(10); //debounce if(GPIO_KEY!=0x0f) //confirm again { //Test column GPIO_KEY=0X0f; switch(GPIO_KEY) { case(0X07): y=0;break; case(0X0b): y=1;break; case(0X0d): y=2;break; case(0X0e) : y=3;break; } //Test line GPIO_KEY=0Xf0; switch(GPIO_KEY) { case(0X70): y=y; x=89;TR1=1;break; case(0Xb0): y=y+4;x=89;TR1=1;break; case(0Xd0): y=y+8;x=89; TR1=1;break; case(0Xe0): y=y+12;x=89;TR1=1;break; } while((a<50)&&(GPIO_KEY!=0xf0)) //Detect key release{ delay(10); a++; } } } }

void Time0_Int()interrupt 1 //Interrupt 0 { TH0=0xFF; TL0=0x38; i++; if(i==100) i=0; if(i>x) pwm=1; else pwm=0; led=0; }

void Time1_Int()interrupt 3 //Interrupt 1 { static int u=0; TH1=0xD8; TL1=0xF0; u++; if(u==time[y]) { u=0; x=87 ; TR1=0; } }

void main() { Time0_Init(); Time1_Init(); while(1) { KeyDown(); } We need to use a ruler to measure the distance between the two boxes, and then use The matrix buttons of the microcontroller input data to the microcontroller, which then controls the capacitive pen to achieve the purpose of controlling the jump.

This is also the place where this work is not intelligent enough. I hope there will be a great god Further improve this work.

Let's take a look at the effect{:1_138: }

跳一跳视频.mp4 (5.39 MB, downloads: 21)

[/backcolor ]

[ attach]373281[/attach]


跳一跳.jpg (2.38 MB, downloads: 0)

跳一跳.jpg

跳一跳排行榜.jpg (37.51 KB, downloads: 0)

跳一跳排行榜.jpg
This post is from Innovation Lab

Latest reply

Awesome  Details Published on 2019-3-1 18:35
 
 

693

Posts

7

Resources
2
 
Great, the post is well written, keep it up, you can post more of this kind of posts in the future, which will be very helpful to you. It can not only deepen your understanding of knowledge, but also improve your ability to express yourself.
This post is from Innovation Lab
 
 
 

1w

Posts

204

Resources
3
 
Haha, not bad, my highest record is 16 points.  I may also need such a plug-in
This post is from Innovation Lab
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
Personal signature

玩板看这里:

http://en.eeworld.com/bbs/elecplay.html

EEWorld测评频道众多好板等你来玩,还可以来频道许愿树许愿说说你想要玩的板子,我们都在努力为大家实现!

 
 
 

2002

Posts

24

Resources
4
 
USB camera + OpenVC distance recognition + serial port transmission to MCU + driver private server motor click = fully automatic
This post is from Innovation Lab
 
 
 

19

Posts

0

Resources
5
 
Great, the post is well written. Keep it up. You can post more of this kind of posts in the future. It will be very helpful to you. It can not only deepen your understanding of knowledge, but also improve your ability to express yourself.
This post is from Innovation Lab
Personal signature好好学习,天天向上
 
 
 

1368

Posts

6

Resources
6
 
Awesome
This post is from Innovation Lab
Personal signature专注智能产品的研究与开发,专注于电子电路的生产与制造……QQ:2912615383,电子爱好者群: void
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list