本文整理汇总了C++中printF函数的典型用法代码示例。如果您正苦于以下问题:C++ printF函数的具体用法?C++ printF怎么用?C++ printF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了printF函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: lsmReadMotionData
void lsmReadMotionData(void)
{
int count;
int tmp_a, tmp_g;
double val_a, val_g;
unsigned char rcv_g[7];
unsigned char rcv_a[7];
lsmCsaLow();
lsmCsgLow();
SPIGBUF = 0xE7; // Read, Auto address increment
SPIABUF = 0x00; // dummy write
for(count=0;count<7;count++)
{
SPIGBUF = 0x00; // dummy write
SPIABUF = 0x00; // dummy write
}
// Wait for TX/RX to complete.. At this speed (~15us) it really isn't worth
// going back to do something else and return when an interrupt occurs
for(count=0;count<100;count++);
lsmCsaHigh();
lsmCsgHigh();
count = SPIGBUF; // dummy read (the initial address byte)
count = SPIABUF; // dummy read
// Both SPIXBUF registers should now be filled with 7 data bytes
for(count=0;count<7;count++)
{
rcv_g[count] = SPIGBUF;
rcv_a[count] = SPIABUF;
//printF("%02Xuc,%02Xuc,",rcv_g[count], rcv_a[count]);
}
//printF("\n\r");
for(count=1;count<7;count+=2)
{
tmp_g = (int)((rcv_g[count+1] << 8) | rcv_g[count]);
tmp_a = (int)((rcv_a[count+1] << 8) | rcv_a[count]);
val_g = ((double)tmp_g)/131.072;
val_a = ((double)tmp_a)/16384.0;
printF("%0+2.2d,%0+2.2d,", val_g, val_a);
}
printF("\n\r");
}
开发者ID:kleinp,项目名称:butler_main,代码行数:53,代码来源:lsm330dlc.c
示例2: P1
void P1(int argc, char* argv[]) {
printF("%d\n",argc);
for(int i=0;i<argc;i++){
printF("%s\n",argv[i]);
}
while( 1 ) {
// compute the gcd between pairs of x and y for 2^4 < x, y < 2^8
for( uint32_t x = ( 1 << 4 ); x < ( 1 << 8 ); x++ ) {
for( uint32_t y = ( 1 << 4 ); y < ( 1 << 8 ); y++ ) {
uint32_t r = gcd( x, y ); //printF( "gcd( %d, %d ) = %d\n", x, y, r );
}
}
}
return;
}
开发者ID:ag14774,项目名称:Realview-PB-A8-Kernel,代码行数:16,代码来源:P1.c
示例3: follow
void follow(char *name1, char *name2, user *head)
{
user *usr = getUserName(name2, head);
user *usr2 = getUserName(name1, head);
follows *root = usr->head;
follows *cur;
if(usr->head==NULL)
{
usr->head = (follows*)malloc(sizeof(follows));
usr->head->usr = usr2;
usr->head->next = usr->head->prev = usr->head;
if(DEBUG)
printf("Followers for %s initiated with %s\n", usr->name, usr2->name);
return;
}
cur=usr->head->prev;
cur->next = (follows*)malloc(sizeof(follows));
cur->next->prev = cur;
cur = cur->next;
cur->next = root;
cur->usr = usr2;
root->prev = cur;
if(DEBUG)
printf("%s added to followers of %s\n", usr2->name, usr->name);
if(DEBUG)
printF(usr);
}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:Algorithms-1,代码行数:32,代码来源:the3.c
示例4: main
/**
* @brief Main program.
* @param None
* @retval None
*/
void main(void)
{
static u16 i=0;
CLK_Config();
UART_Config();
TIM2_Config();
enableInterrupts();
printF("TIM2_Config finish !\n",FALSE,0);
/* Infinite loop */
while (1)
{
_Delay(100);
printF("LOG MSG (%4d) !\n",TRUE,i++);
}
}
开发者ID:glockwork,项目名称:STM8L15x_StdPeriph_Lib_V1.6.2_TIMER2,代码行数:25,代码来源:main.c
示例5: main
int main()
{
char str[100];
intr i,length=0,c=0;
printf("enter any string");
scanf("%d",&str);
length=strlen[str]\;
for(i=0;i<length;i++)
{
if (str[i] >= 50 && str[i]<= 60)
{
printF("%d%d is a string",c,length);
return 0;
}
}
}
开发者ID:VigneshVkl,项目名称:vignesh7,代码行数:16,代码来源:vignesh3.c
示例6: lsmInit
void lsmInit(void)
{
unsigned int i;
SPIGCON1bits.MODE16 = 0; // 8-bit mode
SPIGCON1bits.SMP = 1; // Sample data at end of data output time
SPIGCON1bits.CKE = 0; // SDO changes on idle to active
SPIGCON1bits.CKP = 1; // Clock idles high
SPIGCON1bits.MSTEN = 1; // Master mode
SPIGCON1bits.SPRE = 5; // Secondary prescale bits (based on 140 Mhz)
SPIGCON1bits.PPRE = 2; // Primary prescale bits
SPIGCON2bits.SPIBEN = 1; // enhanced buffer mode (8 deep fifo)
SPIACON1bits.MODE16 = 0; // 8-bit mode
SPIACON1bits.SMP = 1; // Sample data at end of data output time
SPIACON1bits.CKE = 0; // SDO changes on idle to active
SPIACON1bits.CKP = 1; // Clock idles high
SPIACON1bits.MSTEN = 1; // Master mode
SPIACON1bits.SPRE = 5; // Secondary prescale bits (based on 140 Mhz)
SPIACON1bits.PPRE = 2; // Primary prescale bits
SPIACON2bits.SPIBEN = 1; // enhanced buffer mode (8 deep fifo)
SPIACON1bits.DISSCK = 1; // Disable CLK output (provided by SPI1)
SPIACON1bits.DISSDO = 1; // Disable data (MOSI) output (provided by SPI1)
SPIGSTATbits.SPIEN = 1; // Enable the module
SPIASTATbits.SPIEN = 1; // Enable the module
lsmCsaHigh();
lsmCsgHigh();
for(i=0;i<100;i++); // a short delay
printF("WHOAMI: %Xuc\n\r",lsmReadRegister(GYRO,WHO_AM_I_G));
// ACCEL: 100Hz ODR, Normal power, Z, Y, X Enabled
lsmWriteRegister(ACCEL, CTRL_REG1_A, 0b01010111);
// ACCEL: Data LSb @ lower address, +/-2G range, high resolution
lsmWriteRegister(ACCEL, CTRL_REG4_A, 0b00001000);
// GYRO: ODR=380, Cut-off=100Hz, Normal power, Z, Y, X Enabled
lsmWriteRegister(GYRO, CTRL_REG1_G, 0b10111111);
}
开发者ID:kleinp,项目名称:butler_main,代码行数:43,代码来源:lsm330dlc.c
示例7: printF
void Com::config(FSTRINGPARAM(text),uint32_t value){
printF(tConfig);
printFLN(text,value);
}
开发者ID:SweToran,项目名称:R2-3D,代码行数:4,代码来源:Communication.cpp
示例8: printF
void Com::printFLN(FSTRINGPARAM(text),unsigned long value) {
printF(text);
printNumber(value);
println();
}
开发者ID:pascallanger,项目名称:Repetier-Firmware,代码行数:5,代码来源:Communication.cpp
示例9: printF
void LCD_1602_RUS::printF(const wchar_t *_str) {
printF(_str, cols_count);
}
开发者ID:unitay,项目名称:LCD_1602_RUS,代码行数:3,代码来源:LCD_1602_RUS.cpp
示例10: main
int main(int argc, char **argv){
int i,j,value;
char *cad1, *cad2;
int m,n;
PRINT_RESULT = 1;
DEBUG=1;
// For debugging:
//char cadena1[] = "CGAGACGT"; //2,1,0,1,0,2,1,3,3,
//char cadena2[] = "AGACTAGTTAC";//0,1,0,2,3,0,1,3,3,0,2,2,0
if (argc<3) {
printf("\n Usage: ./cadenas-adn filey.adn filex.adn \n\n");
exit(EXIT_FAILURE);
}
printf("\n ---------------- Begin of Needleman-Wunsch implementation -------------------------\n");
// char *cad1=readFile(FILENAME1);
// char *cad2=readFile(FILENAME2);
cad1=readFile(argv[1]);
cad2=readFile(argv[2]);
m = strlen(cad1)-1;
n = strlen(cad2)-1;
a = malloc(sizeof(int) * m);
b = malloc(sizeof(int) * n);
DEBUG=0;
if (DEBUG) printf("\n a[]=");
for(i=0;i<m;i++){
a[i] = convNucleotido(cad1[i]);
if (DEBUG) printf("%d,",a[i]);
}
if (DEBUG) printf("\n");
if (DEBUG) printf("\n b[]=");
for(j=0;j<n;j++){
b[j] = convNucleotido(cad2[j]);
if (DEBUG) printf("%d,",b[j]);
}
if (DEBUG) printf("\n");
//DEBUG=1;
int *f = computeF(m+1,n+1);
if (DEBUG) printF(f,m,n);
genAlignment(f,m+1,n+1);
printf("\n ---------------- End of Needleman-Wunsch implementation -------------------------\n");
exit(EXIT_SUCCESS);
}
开发者ID:adrisons,项目名称:OPP,代码行数:62,代码来源:cadenas-adn.c
示例11: unfollow
void unfollow(char *name1, char *name2, user *head)
{
user *usr1 = getUserName(name1, head);
user *usr2 = getUserName(name2, head);
message *curm, *fwdm, *bckm;
follows *fwd, *bck;
int toDel=0, del=0;
follows *cur = usr2->head;
while(cur->usr != usr1)
cur = cur->next;
if(DEBUG)
printf("%s unfollowed %s\n", usr1->name, usr2->name);
if(cur->next == cur)
{
free(usr2->head);
usr2->head = NULL;
}
else
{
fwd = cur->next;
bck = cur->prev;
if(cur == usr2->head)
usr2->head = fwd;
unlink(cur, fwd, bck);
}
if(DEBUG)
printF(usr2);
curm = usr1->msgs;
if(curm==NULL)
return;
do
{
toDel+=curm->auth==usr2;
curm = curm->next;
}
while(curm!=usr1->msgs);
do
{
if(curm->auth == usr2)
{
if(DEBUG)
printf("Msg %lu deleted from %s\n", curm->id, usr1->name);
if(curm==usr1->msgs)
{
if(curm->next==curm)
{
free(curm);
usr1->msgs=NULL;
break;
}
usr1->msgs = usr1->msgs->next;
}
fwdm = curm->next;
bckm = curm->prev;
unlink(curm, fwdm, bckm);
del++;
curm = fwdm;
continue;
}
curm = curm->next;
}
while(del<toDel);
}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:Algorithms-1,代码行数:71,代码来源:the3.c
示例12: printF
void Com::cap(FSTRINGPARAM(text)) {
printF(tCap);
printFLN(text);
}
开发者ID:lukealford,项目名称:Repetier-Firmware-1.0Dev--Anycubic-Kossel-Linear,代码行数:4,代码来源:Communication.cpp
注:本文中的printF函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论