Recent Posts

Pages: [1] 2 3 ... 10
Programming Questions / Re: Can I do better
Last post by blh64 - Today at 02:24 am
A few more input:

Would be good to set (or read) status of pins in the setup

Pin are better as const byte rather than const int (but it does not matter too much since the optimizer will get rid of those)

digitalRead() does not return a bool but HIGH or LOW... as you depend on pull-down, ideally if you want to keep a book write it as
Code: [Select]
bool doorSwitch =  (digitalRead(doorSwitchPin) == HIGH);thus way you get a real bool (type consistency) and you express if you have a pull-up (or pull down).

HIGH = true = 1
LOW = false = 0
No need for an extra comparison
Project Guidance / Re: All works independently, b...
Last post by Delta_G - Today at 02:24 am
I don't see anything in the schematic.  Can we see the code?
Project Guidance / Re: All works independently, b...
Last post by Delta_G - Today at 02:22 am
The picture where we can see it:

Nano 33 BLE / Re: Nano 33 BLE IMU Calibratio...
Last post by Birkedahl - Today at 02:21 am
Thanks..  I'm in the same boat as you - trial and error.  I've done everything recommended and nothing has worked, so it may be a bad board.  Thinking now I'll probably buy another one, since I know at least some others have gotten the IMU on the nano 33 BLE to work...   

That is what I had anticipated and hoped for, but I came unstuck. Clearly I had left some part
of the timer setup unattended or undefined. Once that oversight had been corrected everything
worked fine without having to 'over think it'.

The way I am envisioning the code to work out that the critical read/writes to and from
the timer registers will all ocurr within one or more ISRs covering those timers.

I believe all, or prehaps most, interrupts are disabled when executing an ISR. If my understanding is
correct then specifically disabling interrupts to protect 16 bit read/writes may not be required.

You are correct.  Inside an ISR you won't need to disable anything and you can just access the register.  The interrupts are already off there. 

BUT the other variables that you use in the ISR to take the readings WILL need critical sections when they're read in the loop code if they're larger than 8 bits. 
Windows 10, it worked with my Arduino Uno. If I need, I have a computer that has kali and mac os in case that's needed.
I dint expect you to, as I explained I have used tabs for the setup and could not find an easy way to present the information. 

however I did point out that the loop only occurs when I un comment client.publish or Serial.print lines.  these are in the code I provided in the body of the text in the heartbeat function.
But the two pieces of code you showed are not a complete sketch so I don't know when/where you initialize things or when/where those pieces of code get called.
Go to Seeed Studio's website, find the product page for the touchscreen, and look under Documentation for the github page for the display library.  Install the library into the Arduino IDE and it should have examples of how to use the display.
Yeah, a guy at the shop sent me some files, but it's etch a sketch stuff.  I'll look around though.  I'm going to buy some different screens online soon, to do some raspberry pi zero projects.  Any recommendations on some books to learn basic C programming?  Thanks again for your help.  Oh, one more thing, any source codes for multiple LED's?  This photoresistor (I think that's what it's called) is super bright, is there a way I can set it to dim? 
If you had the chance to re-spin the PCB...
4-port SPI UART chip
Displays / Re: 2.4" TFT touch display par...
Last post by david_prentice - Today at 02:11 am
I do not have the ILI9338 shield any more.   However this was my (old) readreg report
Code: [Select]

Read Registers on MCUFRIEND UNO shield
controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)

reg(0x0004) 00 54 80 66    Manufacturer ID
reg(0x0005) 00 00   DSI errors
reg(0x0009) 00 00 61 00 00  Status Register
reg(0x000A) 00 08   Get Powsr Mode
reg(0x000B) 00 00   Get Address Mode
reg(0x000C) 00 06   Get Pixel Format
reg(0x000D) 00 00   Get Display Mode
reg(0x000E) 00 00   Get Signal Mode
reg(0x000F) 00 00   Get Diagnostic Result
reg(0x00B0) 00 00   Interface Mode
reg(0x00B1) 00 00 10    Frame Rate Normal
reg(0x00B2) 00 00 10    Frame Rate Idle
reg(0x00B3) 00 00 10    Frame Rate Partial
reg(0x00B4) 00 02 00    Inversion Control
reg(0x00B5) 00 02 02 0A 14  Blanking Porch
reg(0x00B6) 00 0A 02 27 Display Control
reg(0x00B7) 00 06   Entry Mode Set
reg(0x00C0) 00 26 01    Power Control 1
reg(0x00C1) 00 10   Power Control 2
reg(0x00C2) 00 32   Power Control 3
reg(0x00C3) 00 32   Power Control 4
reg(0x00C4) 00 32   Power Control 5
reg(0x00C5) 00 16 28    VCOM Control 1
reg(0x00C6) 00 00   VCOM Control 2
reg(0x00D3) 00 00 93 38 RDID4
reg(0x00DA) 00 54   RDID1
reg(0x00DB) 00 80   RDID2
reg(0x00DC) 00 66   RDID3
reg(0x00E0) 00 0F 22 1B 05 0C 03 49 47 3D 03 1C 04 13 0E 00 GAMMA-P
reg(0x00E1) 00 00 23 26 05 10 04 39 24 4B 03 0B 0B 33 37 0F GAMMA-N

I have only just noticed that your report differs from mine.
Don't worry about my different register comments.   It was an old report.
I would expect your report to give these values e.g.
Code: [Select]

reg(0x0004) 00 54 80 66    Manufacturer ID
reg(0x00B4) 00 02 00    Inversion Control
reg(0x00B6) 00 0A 02 27 Display Control
reg(0x00DB) 00 80   RDID2
reg(0x00E0) 00 0F 22 1B 05 0C 03 49 47 3D 03 1C 04 13 0E 00 GAMMA-P

Which shop did you buy the shield from?   e.g. link to Ebay sale
Pages: [1] 2 3 ... 10