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

coloz 发表于 2013-7-19 21:17

臭乄孒 发表于 2013-7-19 15:11 static/image/common/back.gif
你好各位 我买的是一块 UNOR3的板子 在安装驱动是 不知道怎样在设备管理器里更新驱动程序我点更新找不到 ...

arduino驱动安装方法   http://www.arduino.cn/thread-1008-1-1.html
arduino驱动安装失败的解决方法http://www.arduino.cn/thread-2485-1-1.html

天星1979379768 发表于 2013-7-21 19:27

嗯嗯,同意,顶一个,这个论坛会越来越好的!

daxia108000 发表于 2013-8-10 12:06

新手报到 谢谢

格瑞图 发表于 2013-10-21 15:32

新手上路,多多关照。

wuzpingc 发表于 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);
      
    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编程

coloz 发表于 2013-10-29 13:22

杨影枫 发表于 2013-10-29 12:08
首先谢谢斑竹,我想问下arduino可以直接用C语言编程吗?之前一直搞的是C编程 ...

就是C\C++编程

ヤゞIam_fine 发表于 2013-11-20 10:06

Arduino能不能随机控制几个灯泡的亮,比如有4个灯泡,随机到第二个灯亮,然后延迟5秒灭掉,然后在随机、、、类推,代码怎么打?

coloz 发表于 2013-11-20 16:23

ヤゞIam_fine 发表于 2013-11-20 10:06
Arduino能不能随机控制几个灯泡的亮,比如有4个灯泡,随机到第二个灯亮,然后延迟5秒灭掉,然后在随机、、 ...

按论坛教程一步一步学,就会了

prol 发表于 2014-3-2 11:23

谢谢昂!
页: 1 [2] 3 4 5 6 7 8 9 10 11
查看完整版本: 新手提问必读