资源简介
在arm版上面实现的简单电子钢琴,其主要功能为琴音的播放以及连续播放,琴键按下弹起效果
代码片段和文件信息
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include “jpg.h“
struct coordinate
{
int x;
int y;
};
void get_num(int tp bool *flag struct coordinate *my_xy)
{
bool xdone = false;
bool ydone = false;
struct input_event buf;
while(1)
{
bzero(&buf sizeof(buf));
read(tp &buf sizeof(buf));
if(buf.type == EV_KEY &&
buf.code == BTN_TOUCH &&
buf.value == 0)
{
*flag = true;
break;
}
if(buf.type != EV_ABS)
continue;
if(buf.type == EV_ABS && buf.code == ABS_X)
{
my_xy->x = buf.value;
xdone = true;
}
if(buf.type == EV_ABS && buf.code == ABS_Y)
{
my_xy->y = buf.value;
ydone = true;
}
if(xdone && ydone)
break;
}
}
void *routine(void *arg)
{
system(“killall -s SIGKILL madplay“);
char cmd[30];
bzero(cmd sizeof(cmd));
snprintf(cmd 30 “madplay d%d.mp3“ (int)arg+1);
printf(“arg:%d\n“ (int)arg+1);
system(cmd);
}
int main(int argc char **argv) // ./showimg [image]
- 上一篇:A星算法求解八数码问题
- 下一篇:等值线等值面生成程序
相关资源
- uboot到linux logo显示不间断 补丁
- UNIX/LINUX编程实践教程的源码
- Linux任务管理器
- linux应用层的华容道游戏源代码
- ubuntu9.10 可加载内核模块和字符设备驱
- MP3文件ID3v2ID3v2APEv2标签读取
- 操作系统实验——虚存管理实验
- linux下的发包工具sendip
- 尚观培训linux许巍关于c 的笔记和讲义
- 尚观培训linux董亮老师关于数据结构的
- linux 线程池源码 c 版
- linux C 电梯程序练习
- linux下用多进程同步方法解决生产者
- Linux 操作系统实验(全)
- Linux From Scratch 中文手册
- linux 网络实验 ftp程序
- Linux命令大全离线版&在线版
- 操作系统共享内存实验
- dos 下运行Linux 命令--gnu_utils
- linux 0.12内核源代码
- linux简易shell C实现
- linux实验报告及心得体会
- 基于GTK的Linux环境下的简易任务管理器
- linux扫雷游戏代码
- CAN Linux驱动代码
- Linux系统教材
- intel 82579LM 网卡驱动Linux系统版 v1.9.
- SA1110处理器掌上电脑液晶显示器设计
- 基于Linux的串口服务器设计
- Windows下访问LINUX的利器-SSH
评论
共有 条评论