Search found 960 matches

by basicchip
Sun Oct 20, 2019 3:49 pm
Forum: Software issues
Topic: ArmBASIC - contact debouncing
Replies: 6
Views: 463

Re: ArmBASIC - contact debouncing

And for reference I did some fast clicking on the small button. Seems like about 100 msec is about average for a quick click and a double click occurs in about 300 msec (100 low 100 high 100 low) So for that little push button a debouce time of 20-50 msec would see a double click. Bigger buttons lon...
by basicchip
Sat Oct 19, 2019 11:57 pm
Forum: Software issues
Topic: ARMstamp 11U37 Systick control
Replies: 1
Views: 9

Re: ARMstamp 11U37 Systick control

The multitask.bas example uses TIMER1 to switch tasks not SYSTICK. You can either disable the TIMER1 interrupt VICIntEnClear0 = (1<<TIMER1_IRQn) or disable the TIMER1 T1_TCR = 0 ' TIMER1 disable You should do this at the start of the task in question to avoid a premature interrupt. Just reenable the...
by basicchip
Mon Oct 14, 2019 3:43 pm
Forum: Software issues
Topic: ArmBASIC - contact debouncing
Replies: 6
Views: 463

Re: ArmBASIC - contact debouncing

And the code above is being added as DEBOUNCE.bas in the Examples.
by basicchip
Mon Oct 14, 2019 1:53 am
Forum: Software issues
Topic: ArmBASIC - contact debouncing
Replies: 6
Views: 463

Re: ArmBASIC - contact debouncing

That was a small pushbutton, big toggle switches may bounce longer. If you have a scope you can take a look. If not it you see multiple . printed you need to increase the time. So here is bigger push button, which is normally a good debounce, but if you do half or slow push/release you can get some ...
by basicchip
Mon Oct 14, 2019 12:14 am
Forum: Software issues
Topic: ArmBASIC - contact debouncing
Replies: 6
Views: 463

Re: ArmBASIC - contact debouncing

Buttons and switches bounce, and you have to take that into account. The easiest way is to look for a change in the button then ignore all other changes for a certain debounce time. That can vary a lot depending on the switch. I set up a simple test case on an ARMstamp with a push button between 2 p...
by basicchip
Mon Oct 14, 2019 12:11 am
Forum: Projects
Topic: Darken Ship - via ARMstamp
Replies: 3
Views: 182

Re: Darken Ship - via ARMstamp

Buttons and switches bounce, and you have to take that into account. The easiest way is to look for a change in the button then ignore all other changes for a certain debounce time. That can vary a lot depending on the switch. I set up a simple test case on an ARMstamp with a push button between 2 p...
by basicchip
Wed Oct 09, 2019 4:09 am
Forum: Kitchen sink
Topic: WAIT in a MultiTasking program
Replies: 1
Views: 60

Re: WAIT in a MultiTasking program

I would advise against using WAIT in a multitasking program. It would be better to relinquish your task to the next one. If you were waiting at the end of the task, on the next entry to it, check the TIMER to see if the minimum WAIT time had passed. WAIT itself is not re-entrant, so that 2 tasks cal...
by basicchip
Tue Oct 08, 2019 4:02 am
Forum: Software issues
Topic: ABS & NOT
Replies: 1
Views: 65

Re: ABS & NOT

Logical and bitwise expressions in BASIC use the same named function. It depends on context which one gets applied.

toggled = 1

bitwise NOT toggled = &HFFFFFFFE

ABS (&HFFFFFFFE) = 2 ' because &HFFFFFFE = -2

bitwise NOT 2 = &HFFFFFFFD ' which = -3

so ABS (-3) = 3

...
by basicchip
Tue Sep 17, 2019 12:49 am
Forum: Kitchen sink
Topic: Simple Benchmarks
Replies: 7
Views: 1407

Re: Simple Benchmarks

As part of the Kickstarter for uChip, someone asked about performance of BASIC. So I did a quick comparison of my benchmarks in C vs BASIC. Turns out the integer benchmark runs about the same for C and BASIC. Not real surprising as not much to optimize there. The float benchmark threw me for a bit o...
by basicchip
Sat Sep 07, 2019 7:07 pm
Forum: Future products
Topic: BASIC for Arduino ARM
Replies: 10
Views: 1573

Re: BASIC for Arduino ARM

And the Kickstarter is off and running.

Check it out and join the community, I'll refund the dollar for people with a PayPal account.

https://www.kickstarter.com/projects/70 ... ero-boards