当前位置: 首页 > wzjs >正文

室内设计奖项有哪些湖南seo服务电话

室内设计奖项有哪些,湖南seo服务电话,站长友情链接平台,做购物平台网站客户体验活动Arduino示例代码讲解:ArduinoISP ArduinoISP1. **程序功能概述****功能**:**硬件要求**:**输出**:**警告**:2. **代码结构****全局变量****`setup()` 函数****`loop()` 函数****`avrisp()` 函数****处理串口命令**:支持的命令包括:**其他辅助函数**3. **运行过程**4. **…

Arduino示例代码讲解:ArduinoISP

  • ArduinoISP
    • 1. **程序功能概述**
        • **功能**:
        • **硬件要求**:
        • **输出**:
        • **警告**:
    • 2. **代码结构**
        • **全局变量**
        • **`setup()` 函数**
        • **`loop()` 函数**
        • **`avrisp()` 函数**
        • **处理串口命令**:
        • 支持的命令包括:
        • **其他辅助函数**
    • 3. **运行过程**
    • 4. **注意事项**
    • 视频讲解

ArduinoISP

这段代码是一个Arduino程序,用于将Arduino转换为一个AVR ISP(In-System Programmer),可以用来编程和操作AVR微控制器。

// ArduinoISP version 04m3
// Copyright (c) 2008-2011 Randall Bohn
// If you require a license, see
//     http://www.opensource.org/licenses/bsd-license.php
//
// This sketch turns the Arduino into a AVRISP
// using the following arduino pins:
//
// pin name:    not-mega:         mega(1280 and 2560)
// slave reset: 10:               53
// MOSI:        11:               51
// MISO:        12:               50
// SCK:         13:               52
//
// Put an LED (with resistor) on the following pins:
// 9: Heartbeat   - shows the programmer is running
// 8: Error       - Lights up if something goes wrong (use red if that makes sense)
// 7: Programming - In communication with the slave
//
// 23 July 2011 Randall Bohn
// -Address Arduino issue 509 :: Portability of ArduinoISP
// http://code.google.com/p/arduino/issues/detail?id=509
//
// October 2010 by Randall Bohn
// - Write to EEPROM > 256 bytes
// - Better use of LEDs:
// -- Flash LED_PMODE on each flash commit
// -- Flash LED_PMODE while writing EEPROM (both give visual feedback of writing progress)
// - Light LED_ERR whenever we hit a STK_NOSYNC. Turn it off when back in sync.
// - Use pins_arduino.h (should also work on Arduino Mega)
//
// October 2009 by David A. Mellis
// - Added support for the read signature command
//
// February 2009 by Randall Bohn
// - Added support for writing to EEPROM (what took so long?)
// Windows users should consider WinAVR's avrdude instead of the
// avrdude included with Arduino software.
//
// January 2008 by Randall Bohn
// - Thanks to Amplificar for helping me with the STK500 protocol
// - The AVRISP/STK500 (mk I) protocol is used in the arduino bootloader
// - The SPI functions herein were developed for the AVR910_ARD programmer
// - More information at http://code.google.com/p/mega-isp#include "pins_arduino.h"
#define RESET     SS#define LED_HB    9
#define LED_ERR   8
#define LED_PMODE 7
#define PROG_FLICKER true#define HWVER 2
#define SWMAJ 1
#define SWMIN 18// STK Definitions
#define STK_OK      0x10
#define STK_FAILED  0x11
#define STK_UNKNOWN 0x12
#define STK_INSYNC  0x14
#define STK_NOSYNC  0x15
#define CRC_EOP     0x20 //ok it is a space...void pulse(int pin, int times);void setup() {Serial.begin(19200);pinMode(LED_PMODE, OUTPUT);pulse(LED_PMODE, 2);pinMode(LED_ERR, OUTPUT);pulse(LED_ERR, 2);pinMode(LED_HB, OUTPUT);pulse(LED_HB, 2);
}int error = 0;
int pmode = 0;
// address for reading and writing, set by 'U' command
int here;
uint8_t buff[256]; // global block storage#define beget16(addr) (*addr * 256 + *(addr+1) )
typedef struct param {uint8_t devicecode;uint8_t revision;uint8_t progtype;uint8_t parmode;uint8_t polling;uint8_t selftimed;uint8_t lockbytes;uint8_t fusebytes;int flashpoll;int eeprompoll;int pagesize;int eepromsize;int flashsize;
}
parameter;parameter param;// this provides a heartbeat on pin 9, so you can tell the software is running.
uint8_t hbval = 128;
int8_t hbdelta = 8;
void heartbeat() {if (hbval > 192) hbdelta = -hbdelta;if (hbval < 32) hbdelta = -hbdelta;hbval += hbdelta;analogWrite(LED_HB, hbval);delay(20);
}void loop(void) {// is pmode active?if (pmode) digitalWrite(LED_PMODE, HIGH);else digitalWrite(LED_PMODE, LOW);// is there an error?if (error) digitalWrite(LED_ERR, HIGH);else digitalWrite(LED_ERR, LOW);// light the heartbeat LEDheartbeat();if (Serial.available()) {avrisp();}
}uint8_t getch() {while (!Serial.available());return Serial.read();
}
void fill(int n) {for (int x = 0; x < n; x++) {buff[x] = getch();}
}#define PTIME 30
void pulse(int pin, int times) {do {digitalWrite(pin, HIGH);delay(PTIME);digitalWrite(pin, LOW);delay(PTIME);}while (times--);
}void prog_lamp(int state) {if (PROG_FLICKER)digitalWrite(LED_PMODE, state);
}void spi_init() {uint8_t x;SPCR = 0x53;x = SPSR;x = SPDR;
}void spi_wait() {do {}while (!(SPSR & (1 << SPIF)));
}uint8_t spi_send(uint8_t b) {uint8_t reply;SPDR = b;spi_wait(
http://www.dtcms.com/wzjs/817736.html

相关文章:

  • 陕西网站建设报价注册公司需要多久
  • 网站开发公司员工叫什么名字gzip 网站
  • 自己建网站买玩具品牌vi设计包括什么
  • 文化传播集团网站建设asp网站做文件共享上传
  • swing做网站产品设计品牌有哪些
  • 互联网做网站地推启信聚客通网络营销策划
  • 录音转文字网站开发简单的网页设计
  • c 网站开发技术网站空间150m
  • 江门网站推广优化什么网站利于优化
  • 淄博桓台网站建设定制手机app开发制作多少钱
  • 网站建设的拓扑结构宁波seo快速优化平台
  • 在哪里找人做公司网站域名备案做电影网站
  • 宁波专业网站推广平台咨询物联网平台层
  • 宜春制作网站公司哪家好阿里巴巴有几个网站是做外贸的
  • 蔬菜网站建设系统开发过程中设计代码的原则为
  • 网站视频播放器用什么做的discuz模板制作教程
  • 网站建设书籍2013年的推广是什么意思
  • 网站公司好做吗网址大全2345电脑版下载
  • 网站建设宣传ppt模板工程业绩在哪个平台上查询
  • 网站flash工作压力大怎样缓解焦虑情绪
  • 领优惠卷的网站怎么做wordpress 后台 logo
  • 外贸推广的网站海外营销方案
  • 云盘网站建设做外包胡it网站
  • 网站建设案例包括哪些网站建设工资郑州
  • 摄影网站策划书做资源网站需要什么软件
  • 视频网站 外链小程序源码怎么导入
  • 网站顶部怎么做新浪链接郑州网站建设网站开发
  • 阜宁县住房和城乡建设局网站桂林两江四湖门票多少钱
  • 如何建设网站挣钱大丰市市城乡建设局网站
  • 婚恋网站 备案条件网站全局变量