新手提问必读-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

楼主: coloz

[已解决] 新手提问必读

  [复制链接]
 楼主| 发表于 2013-7-19 21:17 | 显示全部楼层
臭乄孒 发表于 2013-7-19 15:11
你好各位 我买的是一块 UNOR3的板子 在安装驱动是 不知道怎样在设备管理器里更新驱动程序  我点更新找不到 ...

arduino驱动安装方法   http://www.arduino.cn/thread-1008-1-1.html
arduino驱动安装失败的解决方法  http://www.arduino.cn/thread-2485-1-1.html
发表于 2013-7-21 19:27 | 显示全部楼层
嗯嗯,同意,顶一个,这个论坛会越来越好的!
发表于 2013-8-10 12:06 | 显示全部楼层
新手报到 谢谢
发表于 2013-10-21 15:32 | 显示全部楼层
新手上路,多多关照。
发表于 2013-10-22 21:11 | 显示全部楼层
我用一个SD模块(SPI接口)和一个8位数码管模块连在一块UNO R3板子上,SD模块用D!!,D12,D13,D4
数码管模块用D5,D6,D7,并分别连上5v,我想让一个数据显示在数码管上,并且写到SD卡里去,可是现在出现单用数码管模块或者单用SD卡模块都可以,同时接好的话,就连SD卡的初始化都不行了,下面是我的程序
SD用的是官方库文件
/*
  SD card read/write

This example shows how to read and write data to and from an SD card file        
The circuit:
* SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4

created   Nov 2010
by David A. Mellis
updated 2 Dec 2010
by Tom Igoe

This example code is in the public domain.
         
*/

#include <SD.h>

File myFile;
//Pin connected to ST_CP of 74HC595
int latchPin = 7;
//Pin connected to SH_CP of 74HC595
int clockPin = 6;
////Pin connected to DS of 74HC595
int dataPin = 5;
int tab[]={0x03,0x9f,0x25,0x0d,0x99,0x49,0x41,0x1f};
void ShowLED(int data)
{
  for(int i = 0; i < 8; i++)// display 0-7
  {
    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST,tab[7-i]);
      
    digitalWrite(latchPin, HIGH);

   
   
   
    delay(1000);
  }   
  while(1)//stop refresh the registers,then the numbers display steady
  {
    digitalWrite(latchPin, HIGH);
  }
}
void setup()
{
  
  Serial.begin(9600);
  Serial.print("Initializing SD card...");
  // On the Ethernet Shield, CS is pin 4. It's set as an output by default.
  // Note that even if it's not used as the CS pin, the hardware SS pin
  // (10 on most Arduino boards, 53 on the Mega) must be left as an output
  // or the SD library functions will not work.
   pinMode(10, OUTPUT);
   
  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    while(1);
//   return;
  }
  Serial.println("initialization done.");
  
//set pins to output because they are addressed in the main loop
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  for(int i = 0; i < 8; i++)// shut off all the segments before being displayed
  {
    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST,0xff);   
    digitalWrite(latchPin, HIGH);
    delay(10);
  }

}

void loop()
{
  
  
         // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  myFile = SD.open("test.txt", FILE_WRITE);
  
  // if the file opened okay, write to it:
  if (myFile) {
   
    Serial.print("Writing to test.txt...");
    myFile.println("01234567");
    ShowLED(0);
    delay(3000);
        // close the file:
    myFile.close();
    Serial.println("done.");
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");
  }
  
}
发表于 2013-10-29 12:08 | 显示全部楼层
首先谢谢斑竹,我想问下arduino可以直接用C语言编程吗?之前一直搞的是C编程
 楼主| 发表于 2013-10-29 13:22 | 显示全部楼层
杨影枫 发表于 2013-10-29 12:08
首先谢谢斑竹,我想问下arduino可以直接用C语言编程吗?之前一直搞的是C编程 ...

就是C\C++编程
发表于 2013-11-20 10:06 | 显示全部楼层
Arduino能不能随机控制几个灯泡的亮,比如有4个灯泡,随机到第二个灯亮,然后延迟5秒灭掉,然后在随机、、、类推,代码怎么打?
 楼主| 发表于 2013-11-20 16:23 | 显示全部楼层
ヤゞIam_fine 发表于 2013-11-20 10:06
Arduino能不能随机控制几个灯泡的亮,比如有4个灯泡,随机到第二个灯亮,然后延迟5秒灭掉,然后在随机、、 ...

按论坛教程一步一步学,就会了
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-27 20:58 , Processed in 0.101487 second(s), 14 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表