51单片机电子琴C代码
#include
#include
#include
#include
#define uchar unsigned char
typedef unsigned char
typedef signed
typedef unsigned short
typedef signed
typedef unsigned int
typedef signed
typedef float
typedef double
sbit row1 = P1 ^ 0;
sbit row2 = P1 ^ 1;
sbit row3 = P1 ^ 2;
sbit col1 = P0 ^ 1;
sbit col2 = P0 ^ 2;
sbit col3 = P0 ^ 3;
sbit col4 = P0 ^ 4;
sbit col5 = P0 ^ 5;
sbit col6 = P0 ^ 6;
sbit col7 = P0 ^ 7;
#define uint unsigned int
uchar STH0;
uchar STL0;
bit FY=0;
uchar Song_Index=0,Tone_Index=0;
uchar k, key;
sbit SPK=P3^7;
sbit LED1=P1^0;
sbit LED2=P1^1;
sbit LED3=P3^4;
sbit LED4=P3^5;
sbit LED5=P3^6;
void Delay(uint16 count)
{
}
uint8 KeyDown(void)
{
}
uint8 KeyUp(void)
{
}
uint8
{
col1=1; col2=1; col3=1; col4=0; col5=1; col6=1; col7=1;
col1=1; col2=1; col3=1; col4=1; col5=0; col6=1; col7=1;
col1=1; col2=1; col3=1; col4=1; col5=1; col6=0; col7=1;
col1=1; col2=1; col3=1; col4=1; col5=1; col6=1; col7=0;
}
uchar code DSY_CODE[]= {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,
uchar code GE_CODE[]={0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07,
uchar code Song[][100]=
{
{5,3,5,3,5,3,1,2,4,3,2,5,5,3,5,3,5,3,1,2,4,3,2,1,2,2,4,4,3,1,5,2,4,3,2,5,5,3,5,3,5,3,1,2,4,3,2,1,-1},
{1,2,3,4,5,3,1,8,6,4,5,5,3,1,2,3,4,5,3,2,1,2,3,2,5,1,2,3,4,5,3,1,8,6,4,5,3,1,2,3,4,5,3,2,1,2,3,1,1,8,6,4,5,5,1,8,6,4,5,3,1,2,3,4,5,3,2,1,2,3,1,1,-1},//《小红帽》
{1,2,3,1,1,2,3,1,3,4,5,3,4,5,5,6,5,4,3,1,5,6,5,4,3,1,1,5,1,1,5,1,-1},
{5,8,6,8,5,3,5,2,3,5,0,3,5,6,8,5,6,5,3,5,1,3,2,0,3,2,1,2,3,6,5,3,5,6,0,5,8,6,5,3,5,2,5,2,3,2,1,-1},
{5,3,5,3,5,3,2,3,5,5,5,3,6,5,3,5,3,2,1,2,3,5,3,2,1,2,3,6,5,6,5,2,3,5,6,5,6,5,
51单片机电子琴C代 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)