Giter Club home page Giter Club logo

Comments (3)

vladikoms avatar vladikoms commented on July 29, 2024 2

Problem with hx711, i comment it in MakeFile, fixed version
https://github.com/vladikoms/WiringOP-Zero

from wiringop-zero.

kxion avatar kxion commented on July 29, 2024 1

‘for’ loop initial declarations are only allowed in C99 or C11 mode

so

diff --git a/devLib/hx711.c b/devLib/hx711.c
index 3b54efb..33800f9 100644
--- a/devLib/hx711.c
+++ b/devLib/hx711.c
@@ -72,7 +72,8 @@ int hx711Read(uint8_t instId)

    int data = 0;
    // pulse the clock pin 24 times to read the data

- for (uint8_t i = 24; i--;)
+ uint8_t i;
+ for (i = 24; i--;)
{
digitalWrite(sClockPin[instId], HIGH);

@@ -83,7 +84,8 @@ int hx711Read(uint8_t instId)
}

    // set the channel and the gain factor for the next reading using the clock pin

- for (int i = 0; i < sGainBits[instId]; i++)
+ int j;
+ for (j = 0; j < sGainBits[instId]; j++)
{
digitalWrite(sClockPin[instId], HIGH);
digitalWrite(sClockPin[instId], LOW);
@@ -100,7 +102,8 @@ int hx711Read(uint8_t instId)
int hx711ReadAverage(uint8_t times, uint8_t instId)
{
int64_t sum = 0;
- for (uint8_t i = 0; i < times; i++)
+ uint8_t i;
+ for (i = 0; i < times; i++)
{
sum += hx711Read(instId);
}

from wiringop-zero.

shishanyu avatar shishanyu commented on July 29, 2024

Thanks vladikoms

from wiringop-zero.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.