Recent Posts

Pages: [1] 2 3 ... 10
1
ok thank you that fixed to #i problem but where or how do i add that library? i looked in the sonoff folder its in there.
2
Project Guidance / Re: Aquaponic 2.0
Last post by wvmarle - Today at 05:12 am
I'd start with a single node, that's going to be enough of a challenge. I'm doing the same for hydroponics, and it's a lot of work to get it right. Aquaponics is a lot harder, as you're trying to simulate an ecosystem, in which you have more variables to control with less inputs than you have in hydroponics.

$100 - in what currency? I can't really think of a $ that's valuable enough to do all the above on just 100 of them. A single node, maybe. A pH and an ORP sensor take most of such a budget already, other ion sensitive probes such as for nitrite or ammonia are about ten times more expensive. Temperature sensors are cheap. EC a bit more expensive (a remarkably tricky one, but very important for proper growing to know how much minerals you have in the water). Water level sensors can be cheap if all you need is a high/low value.

You will have to add nutrients: first of all the fish feed (use quality aquaponic grade - trace mineral enhanced), secondly you'll usually have to add calcium for proper plant growth, and sometimes you may need to top up trace elements. Those are going to be hard to impossible to automate, that's where the farmer comes in.

For communication: RS485 sounds like the way to go. It can handle 100m easily, and you can connect multiple nodes to a single wire. The RPi can then simply query the nodes one by one at a regular interval, say every 10 minutes or so, to get their latest sensor readings. Nodes may also initiate transmission in case of alarm situations.

RS232 doesn't have the range. Ethernet requires much more complex hardware and protocols.
3
Programming Questions / Re: This is so simple that I c...
Last post by pert - Today at 05:12 am
Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code]// your code is here[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.


That is the reference page for digitalRead(). If you want to know about digitalWrite() (as indicated by the subject of your post) I recommend you look at the digitalWrite() reference page:
https://www.arduino.cc/reference/en/language/functions/digital-io/digitalwrite/
Also study the example sketch File > Examples > 01.Digital > Blink and the associated tutorial:
https://www.arduino.cc/en/Tutorial/Blink

After spending some time with those resources if you still don't understand please come back here with specific questions.
4
Im working on a top secret experiment for the u.s government in order for the project to avoid a mass human extinction by an extraterrestrial race that have a base on the darkside of the moon
So yes we are working on saving the world here Hehehehe

Look guys all i want is to connect
2 sensors to 2 motors to rotate 2 wheels when the sensor is pushed

ITS NOT ROCKET SCIENCE

I have 2 2.7 stepper motors
I want to connect them as the diagram says
To 2 bidirectional flex sensors
So that i can move 2 wheels
How strong the wheels move depends on the programmimg does it not?
5
For some reason I can't wrap my head around the examples given....

Description:
Reads the value from a specified digital pin, either
HIGH or LOW.

Syntax:
 digitalRead(pin)

Parameters:
 pin:- the number of the digital pin you want to read (int)

Returns:
 HIGH or LOW

Example:
 Sets pin 13 to the same value as pin 7, declared as an input.
 int ledPin = 13; //LED connected to digital pin 13
 int inPin = 7; //push button connected to digital pin 7
 int val = 0;   //variable to store the read value


Program:
 void setup()
 {
 pinMode(ledPin, OUTPUT); // sets the digital pin 13 as output
 pinMode(inPin, INPUT);   // sets the digital pin 7 as input
 }
 void loop()
 {
 Â  val = digitalRead(inPin); // read the input pin
 Â  digitalWrite(ledPin, val);// sets the LED to the
buttons value
 }


Could someone give me a bit of assistance.....not with the way DigitalWrite works....but withthe examples given...... or maybe it goes hand in hand?

Thanks
6
Project Guidance / Re: Array Help
Last post by spiwrx - Today at 05:06 am
I am trying to reduce the lines of code in my program by using arrays. I have this written out line for line in over 900 lines of code and it's working just how I want it to. But this is my first sketch and I want to learn more and better ways, so in reading about arrays I figured I could write one array and for loop and pass all of my 19 switches and LEDs through it.

This is for a Pachinko machine(game) I have with 19 switches, and 19 corresponding LED's. If the switch goes LOW (I'm using INPUT_PULLUP on an Arduino MEGA) I want the corresponding LED to go HIGH (light up) and stay lit, regardless of any further action on the switch. In other words anytime the state of the switch changes I want to assign a value of 1 to a variable switchCounter[N] (representing switches 1-19).  If the switchCounter1 == 1 I want the corresponding led1 to light digitalWrite(led1, HIGH).  When the game is over or reset I want to send them all to 0  & LOW again.

I want to use an array (or other method) to simply reduce the size of my code.

from the state change example in the software I modified the following but I assumed I could use arrays as to not have to write out the following for each of the 19 different switches & LED's.

const int  sw1 = 31;    // switch number 1 is actual INPUT_PULLUP pin 31
const int led1 = 1;       // the pin (OUTPUT) that the LED is attached to

// Variables will change:
int switchCounter1 = 0;   // counter for the number of button presses
int switchState1 = 0;         // current state of the button
int previousState1 = 0;     // previous state of the button

void setup() {
  pinMode(sw1, INPUT_PULLUP);
  pinMode(led1, OUTPUT);
}


void loop() {
  switchState1 = digitalRead(sw1);
  if (switchState1 != previousState1) {
    if (switchState1 == LOW) {
      switchCounter1 = 1;
    }
  }
  previousState1 = switchState1;

 if (switchCounter1 == 1){
    digitalWrite(led1, HIGH);
 } else{
    digitalWrite(led1, LOW);
    }
}
7
Project Guidance / interrupt input triggering une...
Last post by tizana - Today at 05:04 am
hello,

so i'm working on dimming lighting project using arduino uno and had a weird behavior on the input interrupt of my push button.

so the dimming light is a classic one. i used an arduino output to drive the optocoplor/triac and i connected the zero crossing signal to the interrupt input pin2 .  i also add a push button for manual operation in the interrupt input pin3.

see the attached file for the schema.


the project work well except some weird behavior on the input interrupt that's triggering unexpectedly when i turn off or on the Electrical power strip which feed the triac circuit and lamp. when i turn it on or off it trigger the button interruption without touching the push button which is connectd to my arduino,

i even removed all the connection between the arduino and the triac circuit and let only the push button connected to the arduino and when i turn on the Electrical power strip of the triac circuit the push button interruption is triggered,

here's a video demonstration of my problem that i made here :  https://www.youtube.com/watch?v=6yDz70JTnzQ   

the only way to minimize this Phenomenon is to add a 100nF capacitor in parallel with the switch.
the switch input interrupt is configured with the internal pull-up resistor.

can anybody have a glue why this happen since i removed all physical connection between the TRIAC and the arduino ?
i saw a similar problem that was discussed in this forum but using arduino 2560 and i didn't see any response to explain why http://forum.arduino.cc/index.php?topic=252430.0

thanks,
8
What are pins 8 & 9 connected to? Post your latest code, also which stepper motor (post a link)?
9
  Am I being ignored? Or does no one know any thing about adding fonts correctly?

   I could really use some help. Please!!!!!!!!

I started from a fresh library library today and re-worked the new library so it would match the original copy and finally seemed to get it worked out but now its telling me it doesn't understand the uint16_t is in my structure for rectangles.


Code: [Select]

typedef struct {
const unsigned char *index;
const unsigned char *unicode;
const unsigned char *data;
unsigned char version;
unsigned char reserved;
unsigned char index1_first;
unsigned char index1_last;
unsigned char index2_first;
unsigned char index2_last;
unsigned char bits_index;
unsigned char bits_width;
unsigned char bits_height;
unsigned char bits_xoffset;
unsigned char bits_yoffset;
unsigned char bits_delta;
unsigned char line_space;
unsigned char cap_height;
} ILI9341_t3_font_t;

struct Rect {
uint16_t x;
uint16_t y;
uint16_t width;
uint16_t height;
};


errors...

Code: [Select]

Arduino: 1.8.2 (Windows 10), TD: 1.36, Board: "Adafruit ESP32 Feather, 80MHz, 921600, None"

In file included from C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_ESP\ili9341_esp_font_Arial.h:4:0,

                 from C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_ESP\ili9341_esp_font_Arial.c:1:

C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_ESP\Grafx_esp.h:188:2: error: unknown type name 'uint16_t'

  uint16_t x;

  ^

C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_ESP\Grafx_esp.h:189:2: error: unknown type name 'uint16_t'

  uint16_t y;

  ^

C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_ESP\Grafx_esp.h:190:2: error: unknown type name 'uint8_t'

  uint8_t width;

  ^

C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_ESP\Grafx_esp.h:191:2: error: unknown type name 'uint8_t'

  uint8_t height;

  ^

exit status 1
Error compiling for board Adafruit ESP32 Feather.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.




if I mark out struct I get errors about undefined reference to gcld font.

Code: [Select]

Arduino: 1.8.2 (Windows 10), TD: 1.36, Board: "Adafruit ESP32 Feather, 80MHz, 921600, None"

Archiving built core (caching) in: C:\Users\Duhjoker\AppData\Local\Temp\arduino_cache_728066\core\core_espessif_esp32_featheresp32_FlashFreq_80,UploadSpeed_921600,DebugLevel_none_e9ba2ad4defe2ff59661c2e93de94328.a
libraries\GameRIot_ESP\Grafx_esp.cpp.o:(.literal._ZN9Grafx_esp8drawCharEsshtth+0x0): undefined reference to `glcdfont'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Adafruit ESP32 Feather.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

10
Project Guidance / Re: li-fi guidance system
Last post by Hudin - Today at 04:58 am
Don't worry about bluetooth just yet. Get the simpler parts of your project working first.

You need to learn the programming language, for example to avoid such mistakes as using "=" instead of the comparison "==".
Thank you very much, i can't believe i ddnt see such a mistake, thank you for pointing it out. Am trying to learn the learn the language but the facilities here are quite limited.
Pages: [1] 2 3 ... 10