ascii

MSP430F149的OLED驱动(硬件SPI)

谁都会走 提交于 2020-01-17 00:43:52
MSP430F149的OLED驱动(硬件SPI) 试验主程序 辅助程序 msp430f149_init.c msp430f149_init.h OLED驱动 OLED_SPI.c OLED_SPI.h 简单的显示图片、ASCII、数字。文字字库太大,懒得写,道理都是一样的。。。 OLED程序在下面 可以直接跳过前面的程序,直接跳入“OLED驱动”程序 具体原理其他博主都有介绍,可以参考其它文章,我就直接上代码了… 试验主程序 main.c # include "OLED_SPI.h" int main ( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD ; CLK_Init ( ) ; //初始化时钟 OLED_GPIO_init ( ) ; //初始化SPI OLED_init ( ) ; //OLED初始化 OLED_clear ( ) ; //清屏 OLED_bmp ( ) ; //显示图片 OLED_4_8_number ( 2 , 30 , 1 ) ; //显示149 OLED_4_8_number ( 2 , 35 , 4 ) ; OLED_4_8_number ( 2 , 40 , 9 ) ; OLED_8_16_ASCII ( 4 , 0 , 10

[资料库]字符编码(一):ASCII码,扩展ASCII码

允我心安 提交于 2020-01-17 00:07:10
ASCII码英文全称America Standard Code for Information Interchange,中文意思:美国信息交换标准码。它已被国际标准化组织(ISO)定为国际标准,称为ISO 646标准。适用于所有拉丁文字字母,ASCII码有7位码和8位码两种形式。ASCII码于1968年提出,用于在不同计算机硬件和软件系统中实现数据传输标准化,在大多数的小型机和全部的个人计算机都使用此码。ASCII码划分为两个集合:128个字符的标准ASCII码和附加的128个字符的扩展ASCII码。 因为1位二进制数可以表示2种状态:0、1;而2位二进制数可以表示4种状态:00、01、10、11;依次类推,7位二进制数可以表示128种状态,每种状态都唯一地编为一个7位的二进制码,对应一个字符(或控制码),这些码可以排列成一个十进制序号0~127。所以,7位ASCII码是用七位二进制数进行编码的,可以表示128个字符,其最高位(b7)用作奇偶校验位。所谓奇偶校验,是指在代码传送过程中用来检验是否出现错误的一种方法,一般分奇校验和偶校验两种。奇校验规定:正确的代码一个字节中1的个数必须是奇数,若非奇数,则在最高位b7添1;偶校验规定:正确的代码一个字节中1的个数必须是偶数,若非偶数,则在最高位b7添1。 第0~32号及第127号(共34个)是控制字符或通讯专用字符,如控制符:LF

ASCII和万国码

房东的猫 提交于 2020-01-16 23:21:48
什么是ASCII 计算机的起初是使用内存中的0101来表示数和机器码。如何用内存中的bit来表示文本一直困扰着人们,毕竟人类主要的信息展示是文字,而不是苦涩的0101。后来ASCII码的发明成功的解决了“部分”问题。说白了ASCII码就是解决了一个以数字形式表示文本的问题。 ASCII码全称为美国信息交换标准码“American Standard Code for Information Interchange”。目前它已被国际标准化组织(ISO)定为国际标准,称为ISO 646标准。适用于所有拉丁文字字母,ASCII码有7位码和8位码两种形式。在计算机的存储单元中,一个ASCII码值占一个字节(8个二进制位) 7位ASCII码是用七位二进制数进行编码的,可以表示128个字符。其最高位(b7)用作奇偶校验位。所谓奇偶校验,是指在代码传送过程中用来检验是否出现错误的一种方法,一般分奇校验和偶校验两种。奇校验规定:正确的代码一个字节中1的个数必须是奇数,若非奇数,则在最高位b7添1;偶校验规定:正确的代码一个字节中1的个数必须是偶数,若非偶数,则在最高位b7添1。 第0~32号及第127号(共34个)是控制字符或通讯专用字符,如控制符:LF(换行)、CR(回车)、FF(换页)、DEL(删除)、BEL(振铃)等;通讯专用字符:SOH(文头)、EOT(文尾)、ACK(确认)等; 第33

打印ASCII码

淺唱寂寞╮ 提交于 2020-01-16 03:36:41
【题目描述】 输入一个除空格以外的可见字符(保证在函数scanf中可使用格式说明符%c读入),输出其ASCII码。 【输入】 一个除空格以外的可见字符。 【输出】 一个十进制整数,即该字符的ASCII码。 【输入样例】 A 【输出样例】 65 【参考程序】 # include <cstdio> # include <iostream> using namespace std ; int main ( ) { char a ; cin >> a ; cout << ( int ) a << endl ; } 来源: CSDN 作者: fjkgh 链接: https://blog.csdn.net/fjkgh/article/details/103987007

Converting Mike Shaffer's RC4Encryption to C#

房东的猫 提交于 2020-01-16 01:11:07
问题 I'm following an article, http://www.4guysfromrolla.com/articles/091802-1.3.aspx, which shows how to convert Mike Shaffer's VB RC4 encryption to C#, however I'm getting different results than the original article, http://www.4guysfromrolla.com/webtech/010100-1.shtml. Using this test link from the original article, http://www.4guysfromrolla.com/demos/rc4test.htm, with a password of "abc" and plain text of "testing123", I get "B9 F8 AA 5D 31 B1 8A 42 1E D4". However, when using the C# version,

converting UTF-8 string to ASCII in pure LUA

大兔子大兔子 提交于 2020-01-15 09:11:53
问题 I have a question about sending and receiving data with special chars. (German Umlauts) When I send the string "Café Zeezicht" with the code below, then on the server-side the string is oke. But how can I receive and decode the receiving data that containing the same chars? Now it look likes "Caf? Zeezicht" I am searching for a pure LUA function, because I have no ability to load libraries. ------------------------------------------------------------ -- Function voor converting ASCII naar

What determines whether a browser will open or download a .txt file?

时光总嘲笑我的痴心妄想 提交于 2020-01-14 10:33:15
问题 Let me start by saying that I am aware that you can specify the Content-Disposition in the header and use either "attachment" or "inline" and this question is NOT about that (at least not directly). I have a file with a .txt extension. I am noticing different browser behavior dependent on the content of that .txt file. If my file contains alphanumeric characters and I paste the location of the file into the URL bar of (say) Chrome, the file opens in the browser. If my file contains an "SI"

Reading lines beyond SUB in Python [duplicate]

落花浮王杯 提交于 2020-01-14 07:21:07
问题 This question already has answers here : Line reading chokes on 0x1A (2 answers) Closed 2 years ago . Newbie question. In Python 2.7.2., I have a problem reading text files which accidentally seem to contain some control characters. Specifically, the loop for line in f will cease without any warning or error as soon as it comes across a line containing the SUB character (ascii hex code 1a). When using f.readlines() the result is the same. Essentially, as far as Python is concerned, the file

How do you send an extended-ascii AT-command (CCh) from Android bluetooth to a serial device?

↘锁芯ラ 提交于 2020-01-14 05:57:07
问题 This one really has me banging my head. I'm sending alphanumeric data from an Android app, through the BluetoothChatService, to a serial bluetooth adaptor connected to the serial input of a radio transceiver. Everything works fine except when I try to configure the radio on-the-fly with its AT-commands. The AT+++ (enter command mode) is received OK, but the problem comes with the extended-ascii characters in the next two commands: Changing the radio destination address (which is what I'm

How to convert a string with character codes above 127 to a byte array properly?

家住魔仙堡 提交于 2020-01-13 12:55:07
问题 I am retrieving ASCII strings encoded with code page 437 from another system which I need to transform to Unicode so they can be mixed with other Unicode strings. This is what I am working with: var asciiString = "\u0094"; // 94 corresponds represents 'ö' in code page 437. var asciiEncoding = Encoding.GetEncoding(437); var unicodeEncoding = Encoding.Unicode; // This is what I attempted to do but it seems not to be able to support the eight bit. Characters using the eight bit are replaced with