虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

boolean

  • 16 16点阵显示汉字原理及显示程序

    16 16点阵显示汉字原理及显示程序 #include "config.h" #define                DOTLED_LINE_PORT        PORTB #define                DOTLED_LINE_DDR                DDRB #define                DOTLED_LINE_PIN                PINB #define                DOTLED_LINE_SCKT        PB1 #define                DOTLED_LINE_SCKH        PB5 #define                DOTLED_LINE_SDA                PB3 #define                DOTLED_ROW_PORT                PORTC #define                DOTLED_ROW_DDR                DDRC #define                DOTLED_ROW_PIN                PINC #define                DOTLED_ROW_A0                PC0 #define                DOTLED_ROW_A1                PC1 #define                DOTLED_ROW_A2                PC2 #define                DOTLED_ROW_A3                PC3 #define                DOTLED_ROW_E                PC4 uint8 font[] = { /*--  调入了一幅图像:这是您新建的图像  --*/ /*--  宽度x高度=16x16  --*/ 0x00,0x00,0x00,0x00,0x08,0x38,0x18,0x44,0x08,0x44,0x08,0x04,0x08,0x08,0x08,0x10, 0x08,0x20,0x08,0x40,0x08,0x40,0x08,0x40,0x3E,0x7C,0x00,0x00,0x00,0x00,0x00,0x00 }; static void TransmitByte(uint8 byte); static void SelectRow(uint8 row); static void FlipLatchLine(void); static void TransmitByte(uint8 byte) {         uint8 i;                  for(i = 0 ; i < 8 ; i ++)         {                 if(byte & (1 << i))                 {                         DOTLED_LINE_PORT |= _BV(DOTLED_LINE_SDA);                 }                 else                 {                         DOTLED_LINE_PORT &= ~_BV(DOTLED_LINE_SDA);                 }                 //__delay_cycles(100);                 DOTLED_LINE_PORT |= _BV(DOTLED_LINE_SCKH);                 //__delay_cycles(100);                 DOTLED_LINE_PORT &= ~_BV(DOTLED_LINE_SCKH);                 //__delay_cycles(100);         } } static void SelectRow(uint8 row) {           //row -= 1;         row |= DOTLED_ROW_PIN & 0xe0;         DOTLED_ROW_PORT = row; } static void FlipLatchLine(void) {         DOTLED_LINE_PORT |= _BV(DOTLED_LINE_SCKT);         DOTLED_LINE_PORT &= ~_BV(DOTLED_LINE_SCKT); } void InitDotLedPort(void) {         DOTLED_LINE_PORT &= ~(_BV(DOTLED_LINE_SCKT) | _BV(DOTLED_LINE_SCKH));         DOTLED_LINE_PORT |= _BV(DOTLED_LINE_SDA);         DOTLED_LINE_DDR |= _BV(DOTLED_LINE_SCKT) | _BV(DOTLED_LINE_SCKH) | _BV(DOTLED_LINE_SDA);                  DOTLED_ROW_PORT |= 0x1f;         DOTLED_ROW_PORT &= 0xf0;         DOTLED_ROW_DDR |= 0x1f; } void EnableRow(boolean IsEnable) {         if(IsEnable)         {                 DOTLED_ROW_PORT &= ~_BV(DOTLED_ROW_E);         }         else         {                 DOTLED_ROW_PORT |= _BV(DOTLED_ROW_E);         } } void PrintDotLed(uint8 * buffer) {         uint8 i , tmp;                  for(i = 0 ; i < 16 ; i ++)         {                 tmp = *buffer ++;                 TransmitByte(~tmp);                 tmp = *buffer ++;                 TransmitByte(~tmp);                 SelectRow(i);                 FlipLatchLine();         } } void main(void) {         InitDotLedPort();                  EnableRow(TRUE);                  while(1)         {                 PrintDotLed(font);                 __delay_cycles(5000);         }          } //---------------------------------------------------- config.h文件 #ifndef        _CONFIG_H #define        _CONFIG_H //#define                GCCAVR #define                CPU_CYCLES        7372800L #ifndef                GCCAVR #define                _BV(bit)        (1 << (bit)) #endif #define                MSB                0x80 #define                LSB                0x01 #define                FALSE                0 #define                TRUE                1 typedef                unsigned char        uint8; typedef                unsigned int        uint16; typedef                unsigned long        uint32; typedef                unsigned char        boolean; #include <ioavr.h> #include <inavr.h> #include "dotled.h" #endif //-----

    标签: 16 点阵显示 汉字 显示程序

    上传时间: 2013-11-18

    上传用户:mnacyf

  • SelectionDemo also has code (not included in the preceding snippet) that changes the table s selecti

    SelectionDemo also has code (not included in the preceding snippet) that changes the table s selection orientation. By changing a couple of boolean values, you can make the table allow either column selections or individual cell selections, instead of row selections.

    标签: SelectionDemo the preceding included

    上传时间: 2015-05-04

    上传用户:gut1234567

  • delphi 自定义网络函数:unit net interface uses sysutils ,windows ,dialogs ,winsock ,classes

    delphi 自定义网络函数:unit net interface uses sysutils ,windows ,dialogs ,winsock ,classes ,comobj ,wininet //得到本机的局域网ip地址 function getlocalip(var localip:string): boolean //通过ip返回机器名 function getnamebyipaddr(ipaddr: string var macname: string): boolean //获取网络中sqlserver列表 function getsqlserverlist(var list: tstringlist): boolean //获取网络中的所有网络类型 function getnetlist(var list: tstringlist): boolean //获取网络中的工作组

    标签: interface sysutils classes dialogs

    上传时间: 2015-05-09

    上传用户:wanghui2438

  • unit Other interface Uses Windows,tlhelp32,PsAPI type PStrData = ^TStrData TStrData

    unit Other interface Uses Windows,tlhelp32,PsAPI type PStrData = ^TStrData TStrData = record Ident: Integer Str: string end TUseInfo=record QQ, Mail, Page:string DL:boolean end TSendMailInfo=record IPAddress, FAddress, FName, FPW, FCName, FCPW:string //发信邮箱检证用户密码 end { FloatToText, FloatToTextFmt, TextToFloat, and FloatToDecimal type codes }

    标签: TStrData interface PStrData Windows

    上传时间: 2014-12-22

    上传用户:asddsd

  • Visual Basic 6.0可以通过调用API函数格式化一个磁盘

    Visual Basic 6.0可以通过调用API函数格式化一个磁盘,无论是软盘还是硬盘。 打开一个新的项目(工程1) ,如果你没有更改过缺省模式,那么Visual Basic 6.0会自动添加一个form1文件,在form1上添加一个命令控件,将下面的代码拷入。 Option Explicit Private Declare Function SHFormatDrive Lib"shell32"( ByVal Hend AS Long,ByVal Drive AS Long,ByVal FormatID AS Long,ByVal Options AS Long) as Long Private Sub FormatDisk(intDrive as integer,blnQuickFormat as boolean) dim lngReturn As Long if (blnQuickFormat) then lngReturn= SHFormatDrive(0,intDrive,0&,1&) else lngReturn= SHFormatDrive(0,intDrive,0&,0&) end if end Sub Private Sub Command1_Click() call FormatDisk(0,True) End Sub 运行此程序。 注意FormatDisk函数的第一个变量很重要,他的值是0,1,2时代表格式化的分别是:A、B、C盘。

    标签: Visual Basic 6.0 API

    上传时间: 2015-10-05

    上传用户:kytqcool

  • 编译原理词法和语法分析

    编译原理词法和语法分析,体内容是产生一个二元式文本文件,扩展名为dyd,可将Pascal程序(测试程序)分解成为一个一个的单词,并查“单词符号与种别对照表”得出其种别,用一数字表示,范围1-56(52-56分别对应保留字integer、real、boolean、char)。

    标签: 编译原理

    上传时间: 2013-12-11

    上传用户:003030

  • 问题描述:编写一个JAVA程序

    问题描述:编写一个JAVA程序,用面向对象设计的方法编写一个电话卡的类。包括卡号、密码、余额、拨入号码等 b)基本要求:类的属性有卡号、密码、余额、拨入号码,电话卡的常用操作可以用连接电话方法、返回余额方法与通电话方法来实现。 c)方法功能描述: 构造方法(PhoneCard(卡号,密码,余额,拨入号码))可以完成属性值初始化赋值,并判断余额,余额为负就退出系统,请在构造方法中将初始时的连接置为false即表示没有连接。 卡号long cardNumber 密码private int password,余额double balance,拨入号码string connectNumber boolean connected(一个布尔类型变量表示电话卡连接状态,初始时默认没有连接,值为false,当调用连接电话方法()后,在判断卡号和密码相匹配后值置为true) 连接电话方法(performConnection(卡号,密码))可以完成检查卡号和密码,它是只有在卡号和密码相匹配时才连接 返回余额方法(getBalance())得到电话卡的余额 通电话方法(performDial())是模拟通过过程中,余额会不断减少,每调用此方法,电话卡的余额减少0。5元,打一次电话调用一次

    标签: JAVA 编写 程序

    上传时间: 2014-01-20

    上传用户:1109003457

  • Delphi6.0函数大全

    Delphi6.0函数大全,Delphi程序员的至爱。∷图书简介∷ 电子图书名:Delphi6函数大全 Delphi6函数大全(1) <> 首部 function AnsiResemblesText(const AText, AOther: string): boolean $[StrUtils.pas功能 返回两个字符串是否相似说明 ANSI(American National Standards Institute)美国国家标准协会 不区分大小写参考 function StrUtils.SoundexProc var StrUtils.AnsiResemblesProc例子 CheckBox1.Checked := AnsiResemblesText(Edit1.Text, Edit2.Text)

    标签: Delphi 6.0 函数

    上传时间: 2016-01-25

    上传用户:mikesering

  • 武林DLL注入源码 VB调用 Private Declare Function CallHotKey Lib "wulin.dll" (ByVal hWnd As Long, ByVal hotke

    武林DLL注入源码 VB调用 Private Declare Function CallHotKey Lib "wulin.dll" (ByVal hWnd As Long, ByVal hotkey As Long) As boolean Private Declare Function CallBase Lib "wulin.dll" (ByVal hWnd As Long, ByVal action As Long) As boolean CallHotKey(窗体句柄,HotKey) HotKey ====0---------17 分别是0-----9 F1-----F8 CallBase(窗体句柄,Action) Action==0-------N 分别实现不同的功能 Action=0 选怪 函数反回值是 布尔值 ( 窗体句柄,Action 窗体句柄,HotKey 都为DWORD值)

    标签: ByVal CallHotKey Function Private

    上传时间: 2013-11-25

    上传用户:maizezhen

  • Floyd-Warshall算法描述 1)适用范围: a)APSP(All Pairs Shortest Paths) b)稠密图效果最佳 c)边权可正可负 2)算法描述: a)初始化:d

    Floyd-Warshall算法描述 1)适用范围: a)APSP(All Pairs Shortest Paths) b)稠密图效果最佳 c)边权可正可负 2)算法描述: a)初始化:dis[u,v]=w[u,v] b)For k:=1 to n For i:=1 to n For j:=1 to n If dis[i,j]>dis[i,k]+dis[k,j] Then Dis[I,j]:=dis[I,k]+dis[k,j] c)算法结束:dis即为所有点对的最短路径矩阵 3)算法小结:此算法简单有效,由于三重循环结构紧凑,对于稠密图,效率要高于执行|V|次Dijkstra算法。时间复杂度O(n^3)。 考虑下列变形:如(I,j)∈E则dis[I,j]初始为1,else初始为0,这样的Floyd算法最后的最短路径矩阵即成为一个判断I,j是否有通路的矩阵。更简单的,我们可以把dis设成boolean类型,则每次可以用“dis[I,j]:=dis[I,j]or(dis[I,k]and dis[k,j])”来代替算法描述中的蓝色部分,可以更直观地得到I,j的连通情况。

    标签: Floyd-Warshall Shortest Pairs Paths

    上传时间: 2013-12-01

    上传用户:dyctj