Introduction
This heading list will be heavily moderated. Post and discuss the potential bugs here, and we will compile a concise list in this sticky post. After defining the trouble, the information will be added here, and the original posts will be removed. Please restrict the posts to programming issues concerning the Atom, Atom-Pro 28 modules only.
Bot Board / Atom 28: IDE version 2.2.1.1
Pulsout If not used correctly command does not control a servo reliably. Not a problem but actually a misunderstood feature.
fix: Pulsout will create a pulse based on the current pin status. If it’s set low it will create positive (high) going pulses. If it’s set high it will create low going pulses. For servos make sure you set the pin to a low first. This makes sure the pulses are positive going. Using the pulsout command without setting the pin used to a high or a low first can cause the pulses to randomly be high or low going.
Sword and Sbyte
[code] Var1 var Sbyte
Result var Long
Var1 = 15
Result = Var1 * 127
serout S_OUT,i57600,"Result : ", SDEC Result, 13] ; Correct 1905
Var1 = -15
Result = Var1 * 127
serout S_OUT,i57600,"Result : ", SDEC Result, 13] ; Bug => -8259441
; Corrected like this for now
if Var1 > 0 then
Result = Var1 * 127
else
Result = -(-Var1 * 127) ; **** due to bug in Basic ****
endif
serout S_OUT,i57600,"Result : ", SDEC Result, 13] ; Correct -1905 [/code]
Bot Board / Atom-Pro 28: IDE version 7.2.0.6
Can’t Connect The new Atom Pro chip isn’t recognized by the Pro IDE.
Fix: Try going to tools, preferences, advanced, and change the reset hold time to 25.
SQR Basically the sqr command is setting the 16bit(high bit) of the result every other time it is run.
Fix: If you always clear the high bit(set to 0) you will get correct square roots for numbers up to 1073741823(ie numbers smaller than 32768*32768).
[code]aa var long
bb var long
for aa = 1 to 2000 step 5
Serout S_OUT, i9600, " aa = “,dec aa,” bb = ",dec sqr(aa) & 0x7FFF,13]
next
loop: goto loop[/code]
**Cos ** function returns wrong values. For now, a “Cos ( i )” returns the “Sin ( i ) + 64” that’s false, the correct formula is Cos ( i ) = Sin ( i + 64 )
Fix : use “sin( i + 64 )” instead of “cos ( i )”