Find Jobs
Hire Freelancers

Debug a Sketch

$10-30 USD

Đã hoàn thành
Đã đăng vào hơn 7 năm trước

$10-30 USD

Thanh toán khi bàn giao
Sketch requires read 10 samples from Channel 1 and Channel 2 from ADC. Average the sample. Calculate a value based on the sample. Serial print the values. Here is what I have..not working. #include <MCP3008.h> // define pin connections #define CS_PIN 12 #define CLOCK_PIN 9 #define MOSI_PIN 11 #define MISO_PIN 10 // put pins inside MCP3008 constructor MCP3008 adc(CLOCK_PIN, MOSI_PIN, MISO_PIN, CS_PIN); // ADC reference voltage / calibration value #define V_REF 3.272 #define NUM_SAMPLES 10 int sum[2] = {0}; // sums of samples taken unsigned char sample_count = 0; // current sample number float voltage[2] = {0.0}; // calculated voltages char l_cnt = 0; // used in 'for' loops void setup() { // open serial port [login to view URL](9600); } void loop() { // take a number of analog samples and add them up while (sample_count < NUM_SAMPLES) { // sample each channel A1 to A2 for (l_cnt = 0; l_cnt < 2; l_cnt++) { sum[l_cnt] += [login to view URL](A1 + l_cnt); } sample_count++; delay(10); } // calculate the voltage for each channel for (l_cnt = 0; l_cnt < 2; l_cnt++) { voltage[l_cnt] = ((float)sum[l_cnt] / (float)NUM_SAMPLES * V_REF) / 1024.0; } [login to view URL](voltage[0] / (33 / 133)); [login to view URL]("\t"); // voltage 2 - B (pin A2) [login to view URL](voltage[1] / (33 / 133)); [login to view URL]("\t"); // reset count and sums sample_count = 0; for (l_cnt = 0; l_cnt < 2; l_cnt++) { sum[l_cnt] = 0; } [login to view URL](""); }'
Mã dự án: 12936154

Về dự án

4 đề xuất
Dự án từ xa
Hoạt động 7 năm trước

Bạn muốn kiếm tiền?

Lợi ích khi chào giá trên Freelancer

Thiết lập ngân sách và thời gian
Nhận thanh toán cho công việc
Phác thảo đề xuất của bạn
Miễn phí đăng ký và cháo giá cho công việc
Đã trao cho:
Avatar người dùng
Hello. I can fix that code today. I'll be online during the next 2 hours, or after 4-5 ours more. Using of the TeamViewer will help to make that job faster, but it is not mandatory.
$25 USD trong 0 ngày
5,0 (21 nhận xét)
4,3
4,3
4 freelancer chào giá trung bình $20 USD cho công việc này
Avatar người dùng
Hello, my name is Henrique, I graduated recently in electronic engineering and my conclusion project was done using the Arduino platform, I believe I have the necessary requirements to complete the project.
$25 USD trong 10 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
A proposal has not yet been provided
$11 USD trong 1 ngày
0,0 (0 nhận xét)
0,0
0,0

Về khách hàng

Cờ của UNITED STATES
Keizer, United States
5,0
48
Phương thức thanh toán đã xác thực
Thành viên từ thg 8 24, 2006

Xác thực khách hàng

Cảm ơn bạn! Chúng tôi đã gửi email chứa đường link để bạn lấy tín dụng miễn phí.
Đã xảy ra lỗi trong khi gửi email của bạn. Hãy thử lại.
Người Dùng Đã Đăng Ký Tổng Số Việc Đã Đăng
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Đang tải xem trước
Đã cấp quyền truy cập vị trí.
Phiên đăng nhập của bạn đã hết hạn và bạn đã bị đăng xuất. Hãy đăng nhập lại.