Recent Posts

Pages: [1] 2 3 ... 10
Displays / Re: Warning to users of some v...
Last post by bumblepom - Today at 11:11 pm
Bill:  Is this "configur(ing) your lcd object constructor to include backlight parameters"?
I just added and removed some // to expose the BL control lines.  BL remains off.

Code: [Select]
// vi:ts=4
// ----------------------------------------------------------------------------
// HelloWorld - simple demonstration of lcd
// Created by Bill Perry 2016-07-02
// This example code is unlicensed and is released into the public domain
// ----------------------------------------------------------------------------
// This sketch is for LCDs that are directly controlled with Arduino pins.
// Sketch prints "Hello, World!" on the lcd
// See below for configuring the Arduino pins used.
// While not all hd44780 use the same pinout, here is the one that most use:
// pin 1 is the pin closest to the edge of the PCB
//  1 - LCD gnd
//  2 - VCC (5v)
//  3 - Vo Contrast Voltage
//  4 - RS Register Select (rs)
//  5 - Read/Write
//  6 - Enable (en)
//  7 - Data 0 (db0) ----
//  8 - Data 1 (db1)     |-------- Not used in 4 bit mode
//  9 - Data 2 (db2)     |
// 10 - Data 3 (db3) ----
// 11 - Data 4 (db4)
// 12 - Data 5 (db5)
// 13 - Data 6 (db6)
// 14 - Data 7 (db7)
// 15 - Backlight Anode (+5v)
// 16 - Backlight Cathode (Gnd)
// ----------------------------------------------------------------------------
// LiquidCrystal compability:
// Since hd44780 is LiquidCrystal API compatible, most existing LiquidCrystal
// sketches should work with hd44780 hd44780_pinIO i/o class once the
// includes are changed to use hd44780 and the lcd object constructor is
// changed to use the hd44780_pinIO class.

#include <hd44780.h>
#include <hd44780ioClass/hd44780_pinIO.h> // Arduino pin i/o class header

// declare Arduino pins used for LCD functions
// and the lcd object

// Note: this can be with or without backlight control:

// without backlight control:
// The parameters used by hd44780_pinIO are the same as those used by
// the IDE bundled LiquidCrystal library
// note that ESP8266 based arduinos must use the Dn defines rather than
// raw pin numbers.
//#if defined (ARDUINO_ARCH_ESP8266)
//const int rs=D8, en=D9, db4=D4, db5=D5, db6=D6, db7=D7; // for esp8266 devices
//const int rs=8, en=9, db4=4, db5=5, db6=6, db7=7;       // for all other devices
//hd44780_pinIO lcd(rs, en, db4, db5, db6, db7);

//with backlight control:
// backlight control requires two additional parameters
// - an additional pin to control the backlight
// - backlight active level which tells the library the level
// needed to turn on the backlight.
// note: If the backlight control pin supports PWM, dimming can be done
// using setBacklight(dimvalue);
// WARNING: some lcd keypads have a broken backlight circuit
// If you have a lcd keypad, it is recommended that you first run the
// LCDKeypadCheck sketch to verify that the backlight circuitry
// is ok before enabling backlight control.
// However, the hd44780_PinIO class will autodetect the issue and
// work around it in s/w. If the backlight circuitry is broken,
// dimming will not be possible even if the backlight pin supports PWM.
      #if defined (ARDUINO_ARCH_ESP8266)
      const int rs=D8, en=D9, db4=D4, db5=D5, db6=D6, db7=D7, bl=D10, blLevel=HIGH;
      const int rs=8, en=9, db4=4, db5=5, db6=6, db7=7, bl=10, blLevel=HIGH;
    hd44780_pinIO lcd(rs, en, db4, db5, db6, db7, bl, blLevel);

// LCD geometry
const int LCD_COLS = 16;
const int LCD_ROWS = 2;

void setup()
// initialize LCD with number of columns and rows:
// note:
// begin() will automatically turn on the backlight if backlight
// control is specified in the lcd object constructor
lcd.begin(LCD_COLS, LCD_ROWS);
// if backlight control was specified, the backlight should be on now

// Print a message to the LCD
lcd.print("Hello, World!");

void loop() {}
Programming Questions / Re: Fill array of struct
Last post by arduino_new - Today at 11:10 pm
The only way you can have your array to fit different sizes is to do dynamic size. But dynamic memory is bad on low memory devices. So your best option is to make your array the biggest size you think it's gonna need
Audio / Please help with my MIDI proje...
Last post by mraddiebaddie - Today at 11:09 pm
Hi All,

I'm very close to giving up on my project after 3 months of trying to figure this out, I know it's not that hard but I have no idea what I am doing.

I have attached photos.

I want to be able to send MIDI data from my DAW to the Arduino then have it trigger 2 solenoids to hit a hi-hat, and also to control a servo that opens/closes it, or controlled by one of the potentiometers. I preferably want control over velocity too. I also want the 6 potentiometers to be able to act as macro knobs to control DAW functions of my choosing, probably a sequencer. Hardware wise it is all finished. The solenoids are on D3 and D5, the Servo is on D2. Pots on 0-5 inputs.

I managed to use the Ableton connection kit for Arduino, and was able to use the knobs as macro, and trigger the solenoids but only with key triggers, or as macro, I couldn't send any midi notes. I realise I need to use the IAC driver, and have figured that out. I have tried hairless MIDI, MIDIbus, processing etc. etc. But I have no idea how to even code or anything, I tried some examples, but don't understand what to change or if i can combine things together.

I would consider paying someone to just do this for me at this stage so I can just paste the code into my Arduino and finally finish this.

I appreciate any help given,


Project Guidance / Re: 1 receiver 250 senders - w...
Last post by Robin2 - Today at 11:08 pm
So each sensor that wants to speak, needs to broadcast a identifier packet of data and wait for teacher to call back it's time to send.
What happens if two sensors send their identifier packets at the same time? Neither will be received. Remember in a classroom the students can raise their arms as a flag - but that is a visual rather than an audible signal so there is no problem with multiple simultaneous flags. And raised-arms don't need to be responded to instantly. There is a well known system called CSMA-CD that could be adapted to deal with wireless collisions but it seems to me it would be a lot of hard work compared with the simple polling system that DrDiettrich suggested.

The HC-12 looks like it has 100 plus usable channels,
If "channel" means frequency (as it does with the nRF24) then I reckon using multiple channels would just add to the complexity. It would also mean that one sensor could not know if another sensor was talking.

Sensors / Re: Bounce (and Bounce 2) Libr...
Last post by tof - Today at 11:07 pm
No. It must be attached to a pin.

If you want to know if a variable "fell" or "rose" simply compare the new value to the previous value.

Without context it is hard to give you a better answer.

LEDs and Multiplexing / Re: Midi controller
Last post by Grumpy_Mike - Today at 11:07 pm
but I have no idea how I connect 2 or more adc's to the Arduino so that I can read 50.
These are SPI devices, so you connect them all to the SPI bus and give each chip its own CE line. Just hold the CE line of the chip you want to address low and them access them as normal.

However that is a bit of an unconventional approach most people go for analogue multiplexers for a lower chip count. You only need four 4067 chips for 64 analogue inputs. As opposed to seven chips the way you want to do things.
@outsider The motor I am using is is a (FF-180PA 2955V). Sadly the only other transistor I have is the (BC547). I tried my best to connect everything according to the diagram you provided, integrating it with a push-button. Following the schematic you provided, I feel as though the motor is even weaker than before. I'm very new to this, maybe I made a mistake somewhere? Was your diagram supposed to circumvent my transistor not having enough power, or was it just a better way to connect things if I did happen to have the right transistor?
Nederlands / Re: Midi controller
Last post by PieterP - Today at 11:06 pm
Je hebt normaal gezien helemaal geen extra ADC nodig, gewoon een paar analoge multiplexers, zeker voor een MIDI controller (die hoeft helemaal niet snel te zijn in vergelijking met andere ADC-toepassingen).

Als je per se de MCP3008 ADCs wilt gebruiken hang je ze gewoon allemaal op de SPI bus, maar elk met een eigen Slave Select lijn.

Well it is so hard to tell because you have no actual parts in there you can use for lookup.

If it were me I would use a 2 or 3A 5V power supply. That should see you through.
When you do
Code: [Select]
char gcode[]="";you have allocated 1 byte (the null character '\0') in memory, pointed by gcode

When then you map your file into memory with
Code: [Select]
while(f.available()) {
      gcode[i] =;
you basically write in random location and overwrite other stuff . From there on you are toast

I don't know why you need to bring the file in memory since the weird stuff you do afterwards is just on checking one byte at a given position - so you could do the parsing while reading the file in SPIFFS

We would recommend not to use the String class in general and remember your SRAM is probably not huge
Pages: [1] 2 3 ... 10