Platform: Arduino w/ATMEGA328P, 16 Mhz
Setting up for a "Rotate" operation, the following is accepted by the compiler:
C = 0
C = 1
The following causes a compiler error:
Dim myBit as bit
myBit = 0
C = myBit
AVR C bit problem.gcb (5): Error: Invalid variable name: C
AVR C bit problem.gcb (5): Warning: Variable name C is used for a system bit on the current chip
Is there a way to set C from a variable?
A while back I did some bit-twiddling with the carry bit. The goal was to turn on one and only one bit in a byte specified by a number. Here's the code:
number = number - ASCIIzero ;convert from ASCII to number
pattern = 0 ;now extract which LED to light
status.c = 1 ;set the carry flag
for i = 0 to number ;rotate to correct position
rotate pattern left
LEDs = pattern ;then light the LED
Maybe that'll give you an idea.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.