Send bytes thrugh the digital pins

Do not throw slippers, I’m noob.
I’m tryng to find similar node like “digitalWrite” in Arduino IDE.

Now i find only i2c and UART nodes, but this does not fit.

I want to learn to control 7segments displays with 74hc595, but without arduino IDE.

Please dont send me to google, just ignore, if you dont want to help.

Hi kolanzev

I have already written a library for just this :smile:

Install in XOD and you are good to go.
bradzilla84/74hc595

not sure how to install?
https://xod.io/docs/guide/using-libraries/

Hi, in XOD/GPIO it digital-read, digital-write , analog-read and analog-write

Greate tanx for anwers, learning bradzilla84/74hc595.

Hi again, it does not work, i crash all my brain.

" Checking Arduino dependencies… Library “ShiftRegister74HC595” is missing
Arduino dependencies missing You have to install these libraries first: “ShiftRegister74HC595"”

Through “File/add library” library does not setup, “Simsso/ShiftRegister74HC595”, library not found.

Yep when that message comes up there should be a button in the bottom right hand corner for install xod will take care of the rest for you. :slight_smile:

Ow… Yes, it starts working, but my program does not work.
I tryng for first time set random sequence in node hc-595-pack, but 7-segment dysplay segments are all OFF, or all ON, what bit or sequence or bits it do i dont know.
That is my program:
00

Dysplay connection is correct, because this code works az it must:

int latchPin = 2; //pin 12 on the 595
int dataPin = 3; //pin 14 on the 595
int clockPin = 4; //pin 11 on the 595

void setup() {
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
}

void loop() {
  
  //0
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, 64);
  digitalWrite(latchPin, HIGH);
  delay(1000);

  //1
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, 121);
  digitalWrite(latchPin, HIGH);
  delay(1000);
  
  //2
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, 36);
  digitalWrite(latchPin, HIGH);
  delay(1000);

  //3
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, 48);
  digitalWrite(latchPin, HIGH);
  delay(1000);
  
  //4
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, 25);
  digitalWrite(latchPin, HIGH);
  delay(1000);  
  
  //5
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, 18);
  digitalWrite(latchPin, HIGH);
  delay(1000);

  //6
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, 2);
  digitalWrite(latchPin, HIGH);
  delay(1000);

  //7
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, 120);
  digitalWrite(latchPin, HIGH);
  delay(1000);

  //8
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, 0);
  digitalWrite(latchPin, HIGH);
  delay(1000);

  //9
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, 24);
  digitalWrite(latchPin, HIGH);
  delay(1000);
}

Can you please make little tutorial for your library?
Or any examples of realy working structure of nods for 1 dysplay, 2 dysplays, matrix 8x8, with a few shift registers?
I am sure it will be useful not only for me.

I don’t personally have one of these chips to test myself, it was proofed and requested by another user

Maybe cesars can help with its use?
let me know if you find a problem more than happy to fix.

:thinking:

hc595-example .xodball (45.6 KB) fix


Wow Verry nice Cesars :blush: do you mind if I include this in the library? (with appropriate citation of course)

No problem, check fix if there is error :wink:

This all is for week of learning.
Trying to repeat 2-th scheme, in the latest version XOD there are problems(
For example i dont know, what is node with “T” letter, guess it must be constant-number now.
“En” - guess constant-boolean.
To “EN” connector of square-wave may connect only one node now.
Think in latest version its unrepeated.

T is time puse, 1= 1sec , 2=2sec, 0.5=1/2sec

the inputs can only have one connection, the outputs can instead be connected to several pins

you download :point_down: ?

if you want to create another sequence equal or similar below, create a new patch (rename to sequence2) copy all sequence content and paste in sequence2, then add the new node to the main

Hi there!
Somehow the Compailer in version 0.32.1 always issues an error. Even if I set it up exactly the same as in the pictures above. Even with a simple circuit like this:

With this Errormessage:
" Compilation failed Command Process exited with code 1 The generated C++ code contains errors. It can be due to a bad node implementation or if your board is not compatible with XOD runtime code. The original compiler error message is above. Fix C++ errors to continue. If you believe it is a bug, report the problem to XOD developers."

This is just saying there was an error. You need to scroll up to see what the actual error was.

Here it is :wink:
" Compiling sketch…

“C:\Users\Computer\xod\packages\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR “-IC:\Users\Computer\xod\packages\packages\arduino\hardware\avr\1.8.2\cores\arduino” “-IC:\Users\Computer\xod\packages\packages\arduino\hardware\avr\1.8.2\variants\standard” “-IC:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\libraries\ShiftRegister74HC595\src” “C:\Users\Computer\AppData\Local\Temp\arduino-sketch-CEFCCC8FE7EB4E2E114A4AEA730E7EC5\sketch\xod_1577478627039_sketch.ino.cpp” -o “C:\Users\Computer\AppData\Local\Temp\arduino-sketch-CEFCCC8FE7EB4E2E114A4AEA730E7EC5\sketch\xod_1577478627039_sketch.ino.cpp.o”

C:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\xod_1577478627039_sketch\xod_1577478627039_sketch.ino:973:44: error: missing template arguments before ‘)’ token
uint8_t mem[sizeof(ShiftRegister74HC595)];
^
C:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\xod_1577478627039_sketch\xod_1577478627039_sketch.ino:977:14: error: invalid use of template-name ‘ShiftRegister74HC595’ without an argument list
using Type = ShiftRegister74HC595*;
^~~~~~~~~~~~~~~~~~~~
C:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\xod_1577478627039_sketch\xod_1577478627039_sketch.ino:977:14: note: class template argument deduction is only available with -std=c++1z or -std=gnu++1z

In file included from C:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\xod_1577478627039_sketch\xod_1577478627039_sketch.ino:967:0:
C:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\libraries\ShiftRegister74HC595\src/ShiftRegister74HC595.h:13:7: note: ‘template class ShiftRegister74HC595’ declared here
class ShiftRegister74HC595
^~~~~~~~~~~~~~~~~~~~
C:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\xod_1577478627039_sketch\xod_1577478627039_sketch.ino:980:41: error: ‘Type’ in namespace ‘xod::bradzilla84__74hc595__hc595_device’ does not name a type
bradzilla84__74hc595__hc595_device::Type output_DEV;
^~~~

C:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\xod_1577478627039_sketch\xod_1577478627039_sketch.ino:995:89: error: ‘Type’ in namespace ‘xod::bradzilla84__74hc595__hc595_device’ does not name a type
template<> struct ValueType<output_DEV> { using T = bradzilla84__74hc595__hc595_device::Type; };
^~~~

C:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\xod_1577478627039_sketch\xod_1577478627039_sketch.ino:1029:48: error: ‘Type’ in namespace ‘xod::bradzilla84__74hc595__hc595_device’ does not name a type
template<> bradzilla84__74hc595__hc595_device::Type getValue<output_DEV>(Context ctx) {
^~~~
C:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\xod_1577478627039_sketch\xod_1577478627039_sketch.ino:1988:20: error: ‘struct xod::bradzilla84__74hc595__hc595_clear::ContextObject’ has no member named ‘_input_DEV’; did you mean ‘_input_CLR’?
ctxObj._input_DEV = node_19.output_OUT;
^~~~~~~~~~
_input_CLR
C:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\xod_1577478627039_sketch\xod_1577478627039_sketch.ino:1988:41: error: ‘struct xod::bradzilla84__74hc595__hc595_set::Node’ has no member named ‘output_OUT’; did you mean ‘output_DONE’?
ctxObj._input_DEV = node_19.output_OUT;
^~~~~~~~~~
output_DONE

Multiple libraries were found for “ShiftRegister74HC595.h”
Used: C:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\libraries\ShiftRegister74HC595

Using library ShiftRegister74HC595 at version 1.3.1 in folder: C:\Users\Computer\AppData\Local\Temp\xod_temp_sketchbookkoulHT\libraries\ShiftRegister74HC595

Error: exit status 1
Compilation failed. "

the repository of the github library has changed. I have uploaded a previous original repository, open “hc595dev” and edit the github address … change “Simsso” x “Cesar-S”

try again

ps: before deleting the directory ShiftRehister74HC595 in …“user”/xod/__ ardulib __

Thank You, it works! :slight_smile:

I have met with the same issue
How can I modify block?
Please kindly help me to work with shift registers in right way with xod