完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
您好:)我有当前的传感器模型:SCT-013Enter(100 A)输出(50毫安)-----我想把它与PIC16F877接口,这里是代码和库,但是对于ARDUIO http://Posial.OpenAc能能能计……测量电流,任何人都能帮助我把它转换成PIC16F877的工作或发送交替代码到工作中去。用PIC?
以上来自于百度翻译 以下为原文 Hello:) I have current sensor Model : SCT-013 Input (100 A) Output ( 50 mA ) ------ I want to interface it with pic16f877a here is the code and library but for arduino https://learn.openenergym...measuring-current-only Can any one help me to convert it to work on pic16f877a Or send alternating code to work with pic ? |
|
相关推荐
1个回答
|
|
完成:
以上来自于百度翻译 以下为原文 Done :) // LCD module connections ***it LCD_RS at RB2_bit; ***it LCD_EN at RB3_bit; ***it LCD_D4 at RB4_bit; ***it LCD_D5 at RB5_bit; ***it LCD_D6 at RB6_bit; ***it LCD_D7 at RB7_bit; ***it LCD_RS_Direction at TRISB2_bit; ***it LCD_EN_Direction at TRISB3_bit; ***it LCD_D4_Direction at TRISB4_bit; ***it LCD_D5_Direction at TRISB5_bit; ***it LCD_D6_Direction at TRISB6_bit; ***it LCD_D7_Direction at TRISB7_bit; // End LCD module connections unsigned int j, n, temp ; long i ; void print_i() { char *text; unsigned char ch ; text = "Current:"; Lcd_Out(2,1,text); // Write result in ASCII format ch = i / 1000; Lcd_Chr(2,10,48+ch); ch = (i / 100 )% 10; Lcd_Chr_CP(48+ch); ch = (i / 10 )% 10; Lcd_Chr_CP(48+ch); Lcd_Chr_CP('.'); ch = i % 10; Lcd_Chr_CP(48+ch); Lcd_Out(2,16,"A"); Delay_ms(1000); } void main() { OPTION_REG = 0x80; TMR0 = 0; INTCON = 0x00; // Disable ADCON1 = 0x80; // Configure analog inputs and Vref // PORTA is input ; // initialize UART1 module // (8 bit, 2400 baud rate, no parity bit... Lcd_Init(); // Initialize LCD Lcd_Cmd(_LCD_CLEAR); // Clear display Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off Lcd_Out(1,2,"Amper Meter"); // Write text in first row do { n=0; i = 0; for ( j = 0; j <= 255u; j++ ) { temp = Adc_Read(n); if (i< temp) i = temp; } i= 2.1*( i -512) ; print_i(); } while(1); // endless loop } |
|
|
|
只有小组成员才能发言,加入小组>>
5362 浏览 9 评论
2093 浏览 8 评论
1992 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3274 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2305 浏览 5 评论
870浏览 1评论
756浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
699浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
750浏览 0评论
644浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-2-24 05:04 , Processed in 1.105410 second(s), Total 75, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191