Recent Posts

Pages: [1] 2 3 ... 10
1
Robotics / Re: Controlling an Arduino con...
Last post by Railroader - Today at 11:16 pm
Next try, and it downloads!

Code: [Select]


#include <grbl.h>


How do I proceed?
2
Programming Questions / Re: Array entered not being re...
Last post by AWOL - Today at 11:16 pm
Does this make things clearer?
3
Read till you receive a '\n'. Next print it.
Indeed it was the end data termination char, in my case it was a double row.
4
Bar Sport / Re: Doesn't someone around her...
Last post by Robin2 - Today at 11:13 pm
I'm lost on my bookmark, sometime I need to erase most of them because I don't remember why I saved :)
When saving a bookmark it is a good idea to give it a name that is meaningful to you and perhaps to include words that you would naturally use when searching for it.

Also it is possible to group bookmarks into things like folders. For example I have one group for all the Threads that I start because that way I can find them without remembering their names :)

...R
5
Sensors / Re: Honeywell HIH-6130 Humidit...
Last post by CrossRoads - Today at 11:13 pm
Just one for each line, and place it at the end of the string of devices.
6
0x80 ,0x02 ,0x50 ,0x30 ,0x02 ,0x20 ,0x10 ,0x040
is not what you think it is. That is a stream of 47 bytes. The serial monitor is an ASCII terminal program dealing with characters. If, from within Arduino for example, you performed Serial.write(0x40) it would output the single byte.

Also, as bookmarks you're using one printable and one non-printable character. Make up your mind. If you're going to generate a data stream from a smart source capable of transmitting bytes instead of characters, use the ASCII codes for STX(2) and ETX(3) as does everybody else. If not, of course use anything you want, but they should both be printable, i.e. <= 0x7F.

WRT to your setup, 9600 baud is very slow, about 1ms per character, so your initial print takes about 16ms to complete. That's eons when compared to what you are doing next. Without testing, just throw a delay(15) in after the print statement to allow that function to complete.
So when you say that it's an ASCII terminal program dealing with characters, when I enter
{0x80 ,0x02 ,0x50 ,0x30 ,0x02 ,0x20 ,0x10 ,0x040}
it's reading

{doesn't exist, STX,2,RS,STX, LF,@, ( }

not (in decimal)

{128,2,80,48,2,32,16,64)

Cause this would technically be 9 bytes since 128 is 2 bytes since it overflows right?


Is this just a property of the Serial Monitor? Even if I use DEC instead of HEX, it'll always be reading them as characters? If I use a Visual Studio Form App to send a byte array of numeric values so that they come in as
{122, 30, 31, 32, 33, 34, 35, 65}  (DEC)
It'll still be read as
{Z, 0, 1, 2, 3, 4, 5, A} (HEX) and not the decimal or even binary

{0111 1010, 0001 1110, 0001 1111, 0001 0000, 0001 0001, 0001 0010, 0001 0011, 100 0001}

I remember reading about the delay but wasn't exactly sure how it affects the program. If I'm not actually printing something I don't need to worry about the delay?
HEX:DEC:BIN
80:128: 1 0000 0000
2: 2: 0000 0010
50: 80: 0101 0000
30:48: 0011 0000
2: 2: 0000 0010
20: 32: 00100000
10:16: 0001 0000
40:64:0100 0000
7
I don't recall how VB5 and VB6 worked very well now, but I did use it for some time. I think the OnComm event was run whenever the GUI had a chance to test if the serial buffer had data available. The data from an OnComm event was used to empty the serial buffer each time the VB dispatch looped through the events.

So I think you need to collect the chunks of data from as many OnComm events as it takes until you have a command line.

The way I define commands nowadays is probably based on what I learned back then. To me, a command starts with the character after a newline ("\n"), and ends with a newline. Once I have a command line I can check if it is valid and then process it.

I recall using lots of string functions for testing the commands and chomping out data.

https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/functions/string-functions

The modern way to do this is to have the Arduino output JSON and then the computer can decode that into a database-ish object (e.g. Python's Dictionary object).
8
Programming Questions / Re: Again stepper problems
Last post by snewpers - Today at 11:12 pm
It waits until the next press where flagRun becomes 1 again and the flagIR is also 1, executing runMemoryToStart();

If the distance is 0 again, it sets both flags back to 0 and waits for another press. This way it will bounce only when StartbuttonState == LOW (pressed) and completes a full run without holding a button.

The stepper keeps running until stepper1.distanceToGo == 0. So the stepper1Pos holds the number of steps, positive or negative, but either way distance to go will count (down) until it reaches zero and than the flags are changed.
9
Displays / Re: Help Please: KMR-1.8 SPI c...
Last post by jwahaus - Today at 11:09 pm
I just got that exact same display (KMR-1.8 SPI) in the mail today and got it up and running quickly with no issues.  I did do a good bit of reading before I attempted it and I've seen both good and bad advice on various internet forums.  The e-bay vendor indicated that the board used the ST7735S driver.

I used the Adafruit libraries:

#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>


I used 2 quad level converters (only needed 5 of the 8 lines) to convert the digital I/O lines to 3.3 v.  The level converters can be purchased on Ebay for about $0.30 each if you buy 5 at a time.   I connected the display to an Arduino Nano which was sitting in a breakout board which provides an additional 3.3V voltage regulator that can handle 2 Amps on the 3.3V line.

I used the following connections.  (all I/O lines went through the 5v to 3.3v level converters)

LED-   ---   GND
LED+   ---   3.3V  (from the breakout board not the Arduino)
CS   ---   Arduino D10 (CS)
SCL   ---   Arduino D13 (SCK)
SDA   ---   Arduino D11 (MOSI)
A0   ---  Arduino D9 (DC)
Reset ---  Arduino D8
VCC   ---   3.3V  (from the breakout board not the Arduino)
GND  ---   GND

I think some people may be having issues because they are trying to power the display using the Arduino's 3.3v output which has a low current limit.  I've also read where people are hooking up VCC to 5V and/or LED+ to 5V.  I think using 5V is asking for trouble as it's beyond the maximum voltage rating of the ST7735 chip.  The display is nice and bright using 3.3V for the LED backlight.
10
Website and Forum / Re: Online/Offline
Last post by pert - Today at 11:07 pm
I think the little box on the left side of the user name indicates whether they're online:



Just curious, what is the use of knowing whether someone is online?
Pages: [1] 2 3 ... 10